NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · npm

CVE-2026-65912: DOMPurify ADD_ATTR predicate skips URI validation

mediumCVSS 4.0 5.3GHSA-cjmm-f4jc-qw8r

Summary DOMPurify allows ADDATTR to be provided as a predicate function via EXTRAELEMENTHANDLING.attributeCheck. When the predicate returns true, isValidAttribute short-circuits the attribute check before URI-safe validation runs.

Published Apr 3, 2026 · Updated Jul 23, 2026

Affected packages

dompurify

Ecosystem
npm
Affected
<= 3.3.1
Fixed in
3.3.2
Check
npm ls dompurify

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

Summary

DOMPurify allows ADD_ATTR to be provided as a predicate function via EXTRA_ELEMENT_HANDLING.attributeCheck. When the predicate returns true, _isValidAttribute short-circuits the attribute check before URI-safe validation runs. An attacker who supplies a predicate that accepts specific attribute/tag combinations can then sanitize input such as ` and have the javascript: URL survive, because URI validation is skipped for that attribute while other checks still pass. The provided PoC accepts href` for anchors and then triggers a click inside an iframe, showing that the sanitized payload executes despite the protocol bypass.

Impact

Predicate-based allowlisting bypasses DOMPurify's URI validation, allowing unsafe protocols such as javascript: to reach the DOM and execute whenever the link is activated, resulting in DOM-based XSS.

Credits

Identified by Cantina’s Apex (https://www.cantina.security).

Credited to christos-eth.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology

More npm vulnerabilities

All npm entries