DOMPurify Flaws Enable XSS Bypass Through ADD_ATTR and Prototype Pollution
Two newly disclosed flaws in DOMPurify can let attackers bypass the library’s sanitization logic and inject malicious attributes or unsafe URLs into supposedly cleaned HTML. One issue, tracked as GHSA-CJMM-F4JC-QW8R, affects deployments that use a predicate function with the ADD_ATTR configuration. If that predicate approves URI-bearing attributes such as href or src, DOMPurify can skip later mandatory safety checks, including protocol validation, allowing dangerous values such as javascript:, vbscript:, or data: to pass through and potentially trigger DOM-based cross-site scripting.
A second flaw, GHSA-CJ63-JHHR-WCXV, stems from prototype pollution when the USE_PROFILES option is enabled. In vulnerable versions, DOMPurify initializes ALLOWED_ATTR as a standard JavaScript array, allowing inherited properties from Array.prototype to influence attribute validation. An attacker able to pollute Array.prototype with entries such as onclick can cause DOMPurify to treat malicious event-handler attributes as explicitly allowed, creating another path to XSS. Together, the disclosures show that applications relying on DOMPurify may remain exposed if they use dynamic attribute approval or operate in environments where prototype pollution is possible.

Get ahead of threats like this
Mallory correlates global threat intelligence with your attack surface — know if you’re exposed before adversaries strike.
How this story unfolded
1 event from the most recent confirmed update back to the earliest known activity.
DOMPurify XSS bypass flaws are publicly disclosed
Two DOMPurify vulnerabilities were publicly disclosed: a logical flaw in ADD_ATTR predicate handling that can skip mandatory URI safety checks, and a prototype pollution issue in USE_PROFILES that can let polluted Array.prototype properties bypass attribute filtering. Both issues could allow malicious attributes or dangerous protocols to survive sanitization and lead to cross-site scripting.
Sources
2 references tracked. Mallory keeps watching after this page renders.
GHSA-CJMM-F4JC-QW8R: GHSA-CJMM-F4JC-QW8R: DOM-based XSS Bypass in DOMPurify via ADD_ATTR Predicate | CVEReports
cvereports.com
Open sourceGHSA-CJ63-JHHR-WCXV: GHSA-cj63-jhhr-wcxv: Prototype Pollution to XSS Bypass in DOMPurify USE_PROFILES | CVEReports
cvereports.com
Open sourceSee the full picture, correlated to your attack surface.
Map indicators from this story to your assets and identify affected systems in minutes.
Every observed campaign, victim, and pivot linked to actors named in this story.
Malware, exploits, and IOCs connected to the activity described here.
YARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Get matching new stories delivered to your team as they break — not the next morning.
Ask questions about this story and take action on the answers.


