Skip to content

Fix security alerts no bot resolves - #54

Merged
gentinel-bot[bot] merged 1 commit into
mainfrom
gentinel/fix-alerts
Oct 30, 2026
Merged

gentinel-bot[bot] merged 1 commit into
mainfrom
gentinel/fix-alerts

Conversation

@gentinel-bot

@gentinel-bot gentinel-bot Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Security alerts (Dependabot, code scanning) open for over a week with no bot PR:

  • code-scanning#1 high: CodeQL js/bad-tag-filter at scripts/guard-egress.mjs:156
FIXED: code-scanning#1 (CodeQL `js/bad-tag-filter`, `scripts/guard-egress.mjs:156`).

- **The bug was real:** the regex for inline `<script>` blocks only recognised a literal `</script>` as the end. But HTML also ends a script at `</script >` or `</script foo>`, and a script with no closing tag runs to the end of the file. Any of those forms could slip a script body past the egress guard's scan.
- **The change:** the end-of-script part of the regex is now `(?:<\/script\b[^>]*>|$)` (case-insensitive), which matches end tags the way the HTML parser does. `\b` keeps `</scripts>` from counting as an end tag. I added a comment explaining this; no suppressions, and the scanning config is untouched.
- **Checked:** spot tests of the regex give the expected results. After a fresh build, `npm run guard:egress` reports the `dist/` output as clean, and `vitest run test/guards` passes (33 tests). I did not run the full test suite.
- **Remaining:** none.

The bot PR clean-up merges this PR once CI is green.

🤖 Opened by the gentinel Claude agent

@gentinel-bot
gentinel-bot Bot merged commit ed0400f into main Oct 30, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants