Skip to content

fix(security): 2 improvements across 2 files#2833

Closed
tomaioo wants to merge 2 commits intophcode-dev:mainfrom
tomaioo:fix/security/dom-based-xss-via-unsanitized-query-para
Closed

fix(security): 2 improvements across 2 files#2833
tomaioo wants to merge 2 commits intophcode-dev:mainfrom
tomaioo:fix/security/dom-based-xss-via-unsanitized-query-para

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented Apr 21, 2026

Summary

fix(security): 2 improvements across 2 files

Problem

Severity: High | File: src-node/www/phoenix-splash/error.html:L11

The page reads mainHeading and mainSpan from URL query parameters, decodes them, and assigns them directly to innerHTML. An attacker can craft a URL containing HTML/JS payloads that execute in the page context.

Solution

Avoid innerHTML for untrusted data. Use textContent/innerText instead, or sanitize with a robust HTML sanitizer (e.g., DOMPurify) if HTML rendering is required.

Changes

  • src-node/www/phoenix-splash/error.html (modified)
  • src/assets/phoenix-splash/live-preview-error.html (modified)

tomaioo added 2 commits April 21, 2026 11:12
- Security: DOM-based XSS via unsanitized query parameters
- Security: DOM-based XSS in live preview error page translations

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
- Security: DOM-based XSS via unsanitized query parameters
- Security: DOM-based XSS in live preview error page translations

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

@abose
Copy link
Copy Markdown
Member

abose commented Apr 22, 2026

Looks good 👍 - can you add a quick comment like:

“I license this contribution under both MIT and GPL”

@abose
Copy link
Copy Markdown
Member

abose commented Apr 26, 2026

Closing due to no repose. The src-node is not available at runtime and hence is ok to drop.

The live-preview-error.html is in the deployed artifact and is affected. But we cannot simply change to text content for it to work. So we have the proper fix in #2851

Closing as this is no longer current.

@abose abose closed this Apr 26, 2026
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