CVE-2026-41240
Description
DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. Versions prior to 3.4.0 have an inconsistency between FORBID_TAGS and FORBID_ATTR handling when function-based ADD_TAGS is used. Commit c361baa added an early exit for FORBID_ATTR at line 1214. The same fix was not applied to FORBID_TAGS. At line 1118-1123, when EXTRA_ELEMENT_HANDLING.tagCheck returns true, the short-circuit evaluation skips the FORBID_TAGS check entirely. This allows forbidden elements to survive sanitization with their attributes intact. Version 3.4.0 patches the issue.
Severity
MEDIUM
CVSS v3
6.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N · source nvd
CVSS v4
6.0
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N · source cna
Exploit chance (EPSS)
0.313%
chance of exploitation in the next 30 days
higher than 24.6% of scored CVEs · 2026-11-17
CISA KEV
Not listed
Public exploit code
Yes
Exploit references (NVD and CNA): 1
Metasploit modules: 0
Nuclei templates: 0
Weakness
- CWE-183: Permissive List of Allowed Inputs
- CWE-79: Improper Neutralization of Input During Web Page Generation
CISA SSVC decision points
| Exploitation | poc |
|---|---|
| Automatable | no |
| Technical impact | partial |
| Scored | 2026-04-23 |
Timeline
- 2026-04-22GitHub advisory published (GHSA-h7mw-gpvr-xq4m)1 day before publication
- 2026-04-23Published by the CNA14:54 UTC
- 2026-04-23CISA SSVC decision recordedsame day
Exploit and advisory records
GitHub advisory GHSA-h7mw-gpvr-xq4m, affected packages:
| Package | Vulnerable versions | Fixed in |
|---|---|---|
| npm dompurify | before 3.4.0 | 3.4.0 |
Affected products
Products listed as vulnerable. Upgrade to the version under "Fixed in", or a later one.
| Product | Vulnerable versions | Fixed in |
|---|---|---|
| cure53 dompurify | before 3.4.0fixed in 3.4.0 | 3.4.0 |
References
- https://github.com/cure53/DOMPurify/commit/c361baa18dbdcb3344a41110f4c48ad85bf48f80
- https://github.com/cure53/DOMPurify/security/advisories/GHSA-h7mw-gpvr-xq4m
- https://github.com/cure53/DOMPurify/releases/tag/3.4.0
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cve_lookup/CVE-2026-41240'curl 'https://api.contrastcyber.com/cve_risk_score/CVE-2026-41240'curl 'https://api.contrastcyber.com/cve_exploit/CVE-2026-41240'curl 'https://api.contrastcyber.com/cve_products/CVE-2026-41240'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- OWASP Top 10 categories by the OWASP Foundation (CC BY 3.0).
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).