Skip to content

fix(security): encode route params in URLs and exclude tests from CodeQL - #3

Merged
jcam2803 merged 2 commits into
developfrom
claude/compassionate-newton-d0gvyh
Nov 19, 2026
Merged

jcam2803 merged 2 commits into
developfrom
claude/compassionate-newton-d0gvyh

Conversation

@jcam2803

@jcam2803 jcam2803 commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Description

This addresses the actionable CodeQL code-scanning alerts. I reproduced them locally with CodeQL CLI 2.27.3 and the same security-and-quality suites that codeql.yml runs. The JavaScript scan produced 62 findings and the Actions scan produced none.

Fixed (4 alerts, js/request-forgery): user-supplied route params are now passed through encodeURIComponent before they go into API URLs:

  • src/pages/movie/[movieId]/index.tsx, src/pages/tv/[tvId]/index.tsx, src/pages/collection/[collectionId]/index.tsx: the SSR fetch to the local API
  • src/components/ResetPassword/index.tsx: the reset-password POST

Before this change, a crafted id like 1%2F..%2F..%2Fsettings could make the server-side render fetch a different API path using the visitor's cookie.

Noise removed (9 alerts): *.test.ts(x) and cypress/ are now excluded from CodeQL. Test fixtures aren't shipped, and they were the only source of the js/clear-text-cookie alerts plus two js/request-forgery alerts. The config is set inline rather than through config-file, because the init step runs in parallel with checkout.

Triaged, no code change (50 alerts). These should be dismissed in the Security tab:

  • js/request-forgery in server/api/servarr/*, plextv.ts, externalapi.ts, and the notification agents: the hosts and webhook URLs are admin-configured by design. Won't fix.
  • js/request-forgery and js/http-to-file-access in server/lib/imageproxy.ts: the base URL is fixed, // and :// are rejected, and cache filenames are hashed and sanitised. False positive.
  • js/user-controlled-bypass at server/routes/auth.ts:272: the check rejects a client-supplied hostname once Jellyfin is configured. False positive.
  • js/xss-through-dom in SettingsTabs: the <select> values come only from the static route list. False positive.
  • js/file-system-race in animelist.ts: the stat is used only for the mtime. False positive.
  • js/file-access-to-http in bin/duplicate-detector: a CI tooling script. Won't fix.
  • js/trivial-conditional (2): upstream code-quality notes. Won't fix.
  • js/missing-rate-limiting (4, Jellyfin and Quick Connect auth): this is a real gap. Seerr has no app-level login rate limiting at all. It's better handled at the reverse proxy than by forking upstream auth code.

How Has This Been Tested?

  • Re-ran the CodeQL JS security-and-quality suite on this branch with the new paths-ignore. The count went from 62 to 50, and none remain in the changed or test files.
  • pnpm typecheck: passed. pnpm lint: 0 errors. Prettier check: clean.

Checklist:

  • I have read and followed the contribution guidelines.
  • Disclosed any use of AI (prepared with Claude Code)
  • Type-check and lint pass
  • Successful build pnpm build (not run locally; CamCore image CI builds it)

Generated by Claude Code

Encode user-supplied path segments before interpolating them into API
URLs (movie/tv/collection SSR fetches and the reset-password POST), so a
crafted id cannot traverse to a different API path. Clears 4
js/request-forgery alerts.

Exclude *.test.ts(x) and cypress/ from CodeQL analysis. Test fixtures
are not shipped and produced 9 false-positive alerts
(js/clear-text-cookie, js/request-forgery). Config is inline because the
init step runs in parallel with checkout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNZbbpoHjgV821zgcUrE4L

Copy link
Copy Markdown
Member Author

Validate PR Template is failing because the "I have read and followed the contribution guidelines" box is unticked. I left it unticked on purpose. The CONTRIBUTING.md inherited from upstream does not allow AI-driven PRs, and this PR was prepared by Claude Code. Ticking the box would be a false statement. The code checks are unaffected.

How to proceed is the repo owner's call: tick the box (this is the CamCore fork, so the upstream policy may not apply here), or change the template rule in pr-validation.yml for this fork. This needs to be settled before anything is upstreamed to seerr-team.


Generated by Claude Code

@jcam2803
jcam2803 marked this pull request as ready for review November 18, 2026 09:23
@jcam2803
jcam2803 merged commit 82b38ff into develop Nov 19, 2026
7 checks passed
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.

2 participants