5.1medium
DOMPurify before 3.3.2 URI Validation Bypass via ADD_ATTR
- Severity
- 5.1medium CVSS:4.0 by VulnCheck
- Exploit likelihood
- 0.18% (higher than 8% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- VulnCheck
- Also known as
- GHSA-cjmm-f4jc-qw8r
Description
DOMPurify before 3.3.2 contains a URI validation bypass vulnerability when ADD_ATTR is provided as a predicate function via EXTRA_ELEMENT_HANDLING.attributeCheck. Attackers can supply a predicate that accepts specific attribute and tag combinations to bypass URI-safe validation, allowing unsafe protocols like javascript: to survive sanitization and execute as DOM-based XSS when the link is activated.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| cure53 DOMPurify | before 3.3.2 Not affected: 3.3.2 | CVE List, NVD |
| dompurify (npm) | before 3.3.2 | GitHub Advisory Database |
All scores
| VulnCheck | 5.1medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N |
| VulnCheck | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N |
Classification
What each source says
CVE List
DOMPurify before 3.3.2 contains a URI validation bypass vulnerability when ADD_ATTR is provided as a predicate function via EXTRA_ELEMENT_HANDLING.attributeCheck. Attackers can supply a predicate that accepts specific attribute and tag combinations to bypass URI-safe validation, allowing unsafe protocols like javascript: to survive sanitization and execute as DOM-based XSS when the link is activated.
GitHub Advisory Database
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 <a href="javascript:alert(document.domain)"> 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).
NVD (es)
DOMPurify anterior a la versión 3.3.2 contiene una vulnerabilidad de omisión de validación de URI cuando ADD_ATTR se proporciona como una función predicado a través de EXTRA_ELEMENT_HANDLING.attributeCheck. Los atacantes pueden proporcionar un predicado que acepta combinaciones específicas de atributos y etiquetas para omitir la validación de URI segura, permitiendo que protocolos inseguros como javascript_disabled: sobrevivan a la sanitización y se ejecuten como XSS basado en DOM cuando el enlace se activa.
References
| https://github.com/cure53/DOMPurify/security/advisories/GHSA-cjmm-f4jc-qw8r | third-party-advisory, vendor-advisory, web | |
| https://www.vulncheck.com/advisories/dompurify-before-uri-validation-bypass-via-add-attr | third-party-advisory | |
| https://github.com/cure53/DOMPurify | package | |
| https://github.com/cure53/DOMPurify/releases/tag/3.3.2 | web | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-65912 changed 2026-07-23 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-cjmm-f4jc-qw8r changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-65912 changed 2026-10-24 | Public domain |