Skip to content

Security: XSS via dangerouslySetInnerHTML in embed-modal#1512

Open
tomaioo wants to merge 2 commits into
cheeaun:mainfrom
tomaioo:fix/security/xss-via-dangerouslysetinnerhtml-in-embed
Open

Security: XSS via dangerouslySetInnerHTML in embed-modal#1512
tomaioo wants to merge 2 commits into
cheeaun:mainfrom
tomaioo:fix/security/xss-via-dangerouslysetinnerhtml-in-embed

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented May 17, 2026

Summary

Security: XSS via dangerouslySetInnerHTML in embed-modal

Problem

Severity: High | File: src/components/embed-modal.jsx:L17

The EmbedModal component uses dangerouslySetInnerHTML with the html prop without sanitization. If an attacker can control the html content, they can inject malicious scripts.

Solution

Sanitize the html prop using a library like DOMPurify before passing it to dangerouslySetInnerHTML. Example: import DOMPurify from 'dompurify'; const cleanHtml = DOMPurify.sanitize(html);

Changes

  • src/components/embed-modal.jsx (modified)

tomaioo and others added 2 commits May 16, 2026 17:10
The EmbedModal component uses dangerouslySetInnerHTML with the html prop without sanitization. If an attacker can control the html content, they can inject malicious scripts.

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
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