Skip to content

Security: Overlay compile trace uses HTML insertion on transformed error content#969

Open
tuanaiseo wants to merge 1 commit intopmmmwh:mainfrom
tuanaiseo:contribai/fix/security/overlay-compile-trace-uses-html-insertio
Open

Security: Overlay compile trace uses HTML insertion on transformed error content#969
tuanaiseo wants to merge 1 commit intopmmmwh:mainfrom
tuanaiseo:contribai/fix/security/overlay-compile-trace-uses-html-insertio

Conversation

@tuanaiseo
Copy link
Copy Markdown

Problem

Compile error entries are inserted with elem.innerHTML = entry.content. Although the code encodes input first, safety depends on third-party transformation behavior (anser + html-entities) and future changes. A malformed or unexpected transformation path could reintroduce executable HTML.

Severity: low
File: overlay/components/CompileErrorTrace.js

Solution

Prefer textContent rendering for message fragments, or sanitize entry.content with a strict sanitizer before assigning to innerHTML.

Changes

  • overlay/components/CompileErrorTrace.js (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

Compile error entries are inserted with `elem.innerHTML = entry.content`. Although the code encodes input first, safety depends on third-party transformation behavior (`anser` + `html-entities`) and future changes. A malformed or unexpected transformation path could reintroduce executable HTML.

Affected files: CompileErrorTrace.js

Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
@codesandbox
Copy link
Copy Markdown

codesandbox bot commented Apr 4, 2026

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

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