Skip to content

fix(live-preview): prevent reflected XSS in browser-not-supported page#2851

Merged
abose merged 1 commit intomainfrom
ai
Apr 26, 2026
Merged

fix(live-preview): prevent reflected XSS in browser-not-supported page#2851
abose merged 1 commit intomainfrom
ai

Conversation

@abose
Copy link
Copy Markdown
Member

@abose abose commented Apr 26, 2026

The error page reflected URL params back via innerHTML, so a crafted URL could inject arbitrary HTML/JS. Switch to safe DOM construction (textContent + createElement) and reduce the strings to plain text with a "\n" line-break marker and a "{0}" placeholder for the phcode.io link, which the page now builds as a hardcoded anchor.

The error page reflected URL params back via innerHTML, so a crafted
URL could inject arbitrary HTML/JS. Switch to safe DOM construction
(textContent + createElement) and reduce the strings to plain text
with a "\n" line-break marker and a "{0}" placeholder for the
phcode.io link, which the page now builds as a hardcoded anchor.
@sonarqubecloud
Copy link
Copy Markdown

@abose abose merged commit 5f08d30 into main Apr 26, 2026
13 of 21 checks passed
@abose abose deleted the ai branch April 26, 2026 16:57
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