Skip to content

Browser scripts: fix the 13 CodeQL alerts (path injection, incomplete escape) - #78

Merged
codeGlaze merged 1 commit into
integrationfrom
feature/registration-in-boot-report
Oct 29, 2026
Merged

codeGlaze merged 1 commit into
integrationfrom
feature/registration-in-boot-report

Conversation

@codeGlaze

Copy link
Copy Markdown
Owner

Follow-up to #70, which merged a few hours before this commit was pushed.

CodeQL flags 13 alerts on #32's ref, all in test scripts (none in app code):

  • 12 js/path-injection: the browser scripts in test/e2e/ each carried their own copy of a tiny static server whose root check CodeQL didn't recognize.
  • 1 js/incomplete-sanitization in test/browser/soak_e2e.js: the regex escape only handled /.

What changed:

  • One shared test/e2e/static-server.js with sequential guards (bad %-encoding and NUL bytes get a 404, then a resolved-path check against the root). The 12 scripts use it instead of their copies.
  • soak_e2e.js escapes every regex special character.

Checked by hand: the helper serves the host page and assets, falls back to the host page for unknown routes, and returns 404 for ../, %2f, bad encoding and NUL. node --check on every changed file. I haven't run the browser scripts against a built app, and CodeQL can't run locally, so the alerts only clear when #32 is re-scanned after this lands.

Test-only, so no changelog line.

…d a full regex escape

The 12 test/e2e scripts each carried an inline copy of the static server, flagged
as js/path-injection by CodeQL (the root-or-inside check was one compound condition).
They now share test/e2e/static-server.js: root serves the host page, a path outside the
root, with a NUL byte or with bad %-encoding gets a 404 before any file read.
soak_e2e.js escapes every regex metacharacter in the section name (js/incomplete-sanitization).

Checked by hand: root, asset, missing route, ../ traversal, bad encoding and NUL. CodeQL
cannot run locally; the alerts clear when it re-scans after this reaches integration.
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codeGlaze
codeGlaze merged commit 75cf6fd into integration Oct 29, 2026
12 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.

1 participant