Skip to content

Fix Dependabot and CodeQL security alerts - #189

Merged
robinroy03 merged 3 commits into
mainfrom
fix/security-alerts
Sep 10, 2026
Merged

robinroy03 merged 3 commits into
mainfrom
fix/security-alerts

Conversation

@robinroy03

@robinroy03 robinroy03 commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes all open Dependabot alerts (148: 122 npm, 26 pip) and the 15 open CodeQL alerts on main.

Dependencies

npm (pnpm audit: 0 findings, was 4 critical / 70 high / 49 moderate / 8 low)

  • remotion + all @remotion/* → 4.0.523 (critical GHSA-2jqp-f4gr-44fr / GHSA-g6pc-6676-c23j; also drops the unpatchable extract-zip dependency)
  • better-auth → ^1.7.4, axios → ^1.20.0, express → ^5.2.1, multer → ^2.3.0, react-router / @react-router/* → ^7.18.3, vite → ^7.3.6
  • Transitive deps refreshed within ranges; added a qs >= 6.16.0 override; dropped stale better-auth/vite/js-yaml/body-parser/qs/tar/minimatch overrides that are now satisfied directly.
  • Added express-rate-limit (see CodeQL below).

pip (backend/uv.lock, targeted uv lock --upgrade-package, tooling versions untouched)

  • cryptography 50.0.1, pyasn1 0.6.4, starlette 1.6.0 / fastapi 0.141.1, urllib3 2.7.0, python-multipart 0.0.32, pydantic-settings 2.15.0, requests 2.34.2, idna 3.19, pygments 2.21.0, python-dotenv 1.2.3

CodeQL

  • Missing rate limiting (13 alerts) — express-rate-limit on every user-facing route in app/videorender/videorender.ts: 300 req/min for reads/deletes, 60 req/min for uploads, clones and render jobs. /health and the renderer-internal /renderer/assets/:id/file proxy (hit by headless Chrome during renders) are deliberately excluded. trust proxy set to 1 so limits key on the real client IP behind nginx.
  • Polynomial regex — sanitizeExportFileName trims dashes with a loop instead of /^-+|-+$/.
  • Workflow permissions — permissions: contents: read added to lint.yml.

Required follow-ups from the upgrades

  • Express 5 typings now type req.params values as string | string[] → routeParam() helper.
  • better-auth 1.7 getSession needs fromNodeHeaders(req.headers).
  • Remotion's @remotion/volume-callback lint rule → callback-form volume in VideoPlayer.tsx.
  • The pre-commit hook (prettier / eslint no-empty / ruff SIM117 / mypy unreachable) blocked the commit on pre-existing issues in touched files, so those are fixed here too. Prettier reformatting accounts for most of the videorender.ts diff.

CI fixes (second commit)

main was already red for both lint jobs. This PR also clears those pre-existing failures so the workflow is green:

  • 7 tsc errors: prop types in LeftPanel, ExportPanel, TrackLabelColumn aligned with the async handlers / Keyframe type they receive; unused showTabs prop dropped; property as any typed; unused MediaBinPage/MediaBinRoute (rendered MediaBin with no props, not referenced anywhere) deleted.
  • 2 eslint errors + 5 react-hooks/exhaustive-deps warnings.
  • Prettier on the 27 files failing format:check; ruff format on backend/ai/schema.py.

Verification

  • pnpm audit → 0 vulnerabilities
  • pnpm typecheck, pnpm eslint . --max-warnings 0, pnpm format:check, pnpm build all pass
  • backend: ruff check, ruff format --check, mypy all pass

Dependencies (npm): bump remotion/@remotion/* to 4.0.523 (drops extract-zip),
better-auth, axios, express, multer, react-router 7.x, vite 7.x; refresh
transitive deps and add a qs override. pnpm audit now reports 0 findings.

Dependencies (pip): upgrade cryptography, pyasn1, starlette/fastapi, urllib3,
python-multipart, pydantic-settings, requests, idna, pygments, python-dotenv
in backend/uv.lock to their patched versions.

CodeQL:
- Add express-rate-limit to all user-facing render-server routes
  (renderer-internal asset proxy and /health intentionally excluded).
- Replace the polynomial `^-+|-+$` regex in sanitizeExportFileName.
- Add read-only `permissions` block to the lint workflow.

Follow-ups from the upgrades: Express 5 typings now allow string[] params
(routeParam helper), better-auth needs fromNodeHeaders for getSession, and
Remotion's lint rule wants volume callbacks in VideoPlayer. Also clears the
pre-commit blockers (prettier on touched files, no-empty catch, ruff SIM117
and mypy unreachable in ai/routes.py).
@codacy-production

codacy-production Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 4 complexity · 63 duplication

Metric Results
Complexity 4
Duplication 63

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Frontend:
- Fix the 7 pre-existing tsc errors: align LeftPanel/ExportPanel/
  TrackLabelColumn prop types with the async handlers and Keyframe type
  they receive, drop the unused `showTabs` prop, type the keyframe track
  property instead of `any`, and delete the unused MediaBinPage/
  MediaBinRoute components that rendered MediaBin without props.
- Fix the 2 eslint errors (duplicate import, explicit any) and 5
  react-hooks/exhaustive-deps warnings (stable refs/callbacks added to deps;
  redundant `timeline` dep removed where getAllScrubbers already tracks it).
- Run prettier on the 27 files that failed format:check.

Backend: ruff format ai/schema.py.

tsc, eslint --max-warnings 0, prettier --check, react-router build, ruff
check/format and mypy all pass locally.
pnpm/action-setup@v4 errors out when both its `version` input and
package.json's `packageManager` field are set, which is why the frontend
job has been failing at setup.
@robinroy03
robinroy03 merged commit 4318a8f into main Sep 10, 2026
9 checks passed
robinroy03 added a commit that referenced this pull request Sep 10, 2026
CodeQL flagged the one route left without a limiter after #189. Headless
Chrome fetches assets through this route during renders, so it gets a
deliberately loose per-IP limit (2000/min) rather than the user-facing ones.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant