Fixes code-scanning alerts #2-#5 (js/bad-tag-filter, js/incomplete-multi-character-sanitization, js/double-escaping) in packages/jarvis-file-backend/lib/context-reader.js and #1 (actions/missing-workflow-permissions) in .github/workflows/ci.yml.
Tag/block removal loops until the text is stable, so split tags such as <scr<script>x</script>ipt> cannot reassemble.
Closing </script ...> / </style ...> variants are matched.
& is decoded last.
Workflow-level permissions: contents: read.
Verification: node --check and a smoke test with nested/split tags and encoded entities (output contains no tags).
Fixes #2
Fixes code-scanning alerts #2-#5 (`js/bad-tag-filter`, `js/incomplete-multi-character-sanitization`, `js/double-escaping`) in `packages/jarvis-file-backend/lib/context-reader.js` and #1 (`actions/missing-workflow-permissions`) in `.github/workflows/ci.yml`.
- Tag/block removal loops until the text is stable, so split tags such as `<scr<script>x</script>ipt>` cannot reassemble.
- Closing `</script ...>` / `</style ...>` variants are matched.
- `&` is decoded last.
- Workflow-level `permissions: contents: read`.
Verification: `node --check` and a smoke test with nested/split tags and encoded entities (output contains no tags).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
## CodeQL / Incomplete multi-character sanitization
This string may still contain [<script](1), which may cause an HTML element injection vulnerability.
[Show more details](https://github.com/KofTwentyTwo/jarvis-file/security/code-scanning/7)
## CodeQL / Incomplete multi-character sanitization
This string may still contain [<style](1), which may cause an HTML element injection vulnerability.
[Show more details](https://github.com/KofTwentyTwo/jarvis-file/security/code-scanning/6)
Checking for merge conflicts…
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes #2
Fixes code-scanning alerts #2-#5 (
js/bad-tag-filter,js/incomplete-multi-character-sanitization,js/double-escaping) inpackages/jarvis-file-backend/lib/context-reader.jsand #1 (actions/missing-workflow-permissions) in.github/workflows/ci.yml.<scr<script>x</script>ipt>cannot reassemble.</script ...>/</style ...>variants are matched.&is decoded last.permissions: contents: read.Verification:
node --checkand a smoke test with nested/split tags and encoded entities (output contains no tags).🤖 Generated with Claude Code
@@ -43,0 +46,4 @@.replace(/<style\b[\s\S]*?<\/style\b[^>]*>/gi, "").replace(/<[^>]+>/g, " ");}return textCodeQL / Incomplete multi-character sanitization
This string may still contain <script, which may cause an HTML element injection vulnerability.
Show more details
@@ -43,1 +47,4 @@.replace(/<[^>]+>/g, " ");}return text.replace(/ /g, " ")CodeQL / Incomplete multi-character sanitization
This string may still contain <style, which may cause an HTML element injection vulnerability.
Show more details
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.