Skip to content

fix(security): recognised sanitizer for js/log-injection (follow-up to #1398) - #1400

Merged
pathosDev merged 1 commit into
developfrom
fix/security-and-quality-alerts
Sep 1, 2026
Merged

fix(security): recognised sanitizer for js/log-injection (follow-up to #1398)#1400
pathosDev merged 1 commit into
developfrom
fix/security-and-quality-alerts

Conversation

@pathosDev

Copy link
Copy Markdown
Owner

Follow-up to #1398.

After #1398 merged, CodeQL's develop scan closed alerts 10/11/15 but opened a new js/log-injection alert (#16) on examples/voice/static/plain/index.html: the sanitizer used there (String.replace(/[^\w.:-]/g, '')) strips newlines but is not a form CodeQL models as a sanitizer, so the tainted kind still flowed into console.debug.

This switches to encodeURIComponent(String(m?.kind ?? '')), which CodeQL recognises as a log-injection sanitizer — clearing #16 while keeping the value safe to log.

🤖 Generated with Claude Code

The previous fix sanitized the unhandled-message `kind` with a
character-class replace that CodeQL does not model as a sanitizer, so
js/log-injection reopened as alert #16 on the rewritten line. Switch to
encodeURIComponent, which CodeQL recognises, keeping the value safe to log.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread examples/voice/static/plain/index.html Dismissed
@pathosDev
pathosDev merged commit 767cd72 into develop Sep 1, 2026
22 checks passed
@pathosDev
pathosDev deleted the fix/security-and-quality-alerts branch September 1, 2026 09:04
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