Skip to content

fix(web): escape fenced code language attributes - #10

Draft
lukisch wants to merge 1 commit into
mainfrom
fix/code-fence-language-escape-20261015
Draft

lukisch wants to merge 1 commit into
mainfrom
fix/code-fence-language-escape-20261015

Conversation

@lukisch

@lukisch lukisch commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

The web renderer inserts a fenced code block's language string directly into a quoted HTML class attribute. A quote followed by an img tag breaks out of that attribute and becomes additional markup in the preview. Escape this string with the existing HTML-escaping function before interpolation.

Add six Node built-in renderer tests that execute the shipped render functions without evaluating their HTML. Four malicious/attribute-special-character cases fail on exact base 0aea162 and pass after the fix. Ordinary language/body escaping and Unicode remain covered. Run these tests explicitly with Node22 in the existing eight native Windows/Linux CI cells.

Validation: 6 renderer cases and 9 existing web-companion tests pass locally; workflow YAML parses; git diff --check passes. Native CI and independent review remain pending. No version, dependencies of the application, release, service-worker cache or runtime mirror change.

Related to CodeQL alert3's preview HTML sink. This fixes the reproduced code-fence attribute injection only; it does not establish complete sanitizer safety or resolve every alert flow. Do not dismiss the alert on this evidence alone. No browser exploit was executed.

Author model: gpt-6.1-sol (Codex). Draft only; merges disabled. Independent model review pending.

Generated-with: gpt-6.1-sol (Codex)
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