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.
Predictions
Heuristic predictions, AS-IS, for prioritization only.
Mitigations
No mitigations published for this CVE yet.
The vendor-content worker queues fetches as references arrive (check back in a few minutes). Or โ if you've already worked around this in production โ publish your fix to the community-verified tier.
โ Propose a mitigation on Community โ Mitigations published via the community go through AI scoring + 2 human reviewers + 7-day silent objection window before landing here withsource_tier=community-verified.
OS impact
Debian Mixed 4 releases
| Version | Status | Fixed in |
|---|---|---|
| trixie | Affected | โ |
| sid | Fixed | 3.4.1+dfsg-1 |
| forky | Fixed | 3.4.1+dfsg-1 |
| bookworm | Affected | โ |
Package impact
| Ecosystem | Package | Vulnerable | Fixed |
|---|---|---|---|
| npm | dompurify | <3.4.0 | 3.4.0 |
Application impact
| Vendor | Product | Versions | Fixed |
|---|---|---|---|
| cure53 | dompurify | {"endExcluding":"3.4.0"} | 3.4.0 |
References
- https://github.com/cure53/DOMPurify/commit/c361baa18dbdcb3344a41110f4c48ad85bf48f80
- https://github.com/cure53/DOMPurify/releases/tag/3.4.0
- https://github.com/cure53/DOMPurify/security/advisories/GHSA-h7mw-gpvr-xq4m
- https://nvd.nist.gov/vuln/detail/CVE-2026-41240
- https://github.com/cure53/DOMPurify
- https://security-tracker.debian.org/tracker/CVE-2026-41240
CWEs
CWE-79 CWE-183
Community-verified mitigations for this CVE will appear above when contributors publish them.
Verify integrity in audit chain (admin only). AS-IS.