Intel

AIKIDO-2026-287506

rhukster/dom-sanitizer is vulnerable to Cross-Site Scripting (XSS)

GHSA-4hr3-f334-mcr4Published Sep 22, 2026
September 22, 2026

61

CVE Score

Medium

Cross-Site Scripting (XSS)

Are you affected? Scan for Free

TL;DR

dom-sanitizer only walks allow-listed elements and never visits XML processing instructions, comments, or CDATA sections, so markup hidden inside <?...?>, <!--...-->, or <![CDATA[...]]> survives sanitization unescaped. When the sanitized SVG or MathML is inserted inline into an HTML page, the hidden markup becomes live and can run injected <img onerror>-style payloads. The fix walks every document node, strips processing instructions and comments, and re-serializes CDATA content as escaped text.

How do I fix this?

Upgrade the rhukster/dom-sanitizer library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you insert the sanitized SVG or MathML output inline into an HTML page.

Versions

1.0.5 - 1.0.16

Fixed in 1.0.17

Background info

rhukster/dom-sanitizer is vulnerable to Cross-Site Scripting (XSS) in versions 1.0.5 - 1.0.16.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea