Skip to content

Security: Potential DOM XSS via unsanitized stack frame rendering#968

Open
tuanaiseo wants to merge 2 commits intopmmmwh:mainfrom
tuanaiseo:contribai/fix/security/potential-dom-xss-via-unsanitized-stack-
Open

Security: Potential DOM XSS via unsanitized stack frame rendering#968
tuanaiseo wants to merge 2 commits intopmmmwh:mainfrom
tuanaiseo:contribai/fix/security/potential-dom-xss-via-unsanitized-stack-

Conversation

@tuanaiseo
Copy link
Copy Markdown

Problem

Runtime error overlay renders functionName and fileName into the DOM using innerHTML. Stack frame fields can be attacker-influenced in some browser/runtime scenarios (e.g., crafted error messages/source URLs), which may allow script/HTML injection in the developer browser session.

Severity: medium
File: overlay/components/RuntimeErrorStack.js

Solution

Avoid innerHTML for dynamic values. Use textContent and build spacing/layout with separate text nodes or CSS. If HTML is required, sanitize with a strict allowlist sanitizer before insertion.

Changes

  • overlay/components/RuntimeErrorStack.js (modified)
  • overlay/components/CompileErrorTrace.js (modified)

Testing

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

Runtime error overlay renders `functionName` and `fileName` into the DOM using `innerHTML`. Stack frame fields can be attacker-influenced in some browser/runtime scenarios (e.g., crafted error messages/source URLs), which may allow script/HTML injection in the developer browser session.

Affected files: RuntimeErrorStack.js, CompileErrorTrace.js

Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
Runtime error overlay renders `functionName` and `fileName` into the DOM using `innerHTML`. Stack frame fields can be attacker-influenced in some browser/runtime scenarios (e.g., crafted error messages/source URLs), which may allow script/HTML injection in the developer browser session.

Affected files: RuntimeErrorStack.js, 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