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
Vendor advisory: debian — https://security-tracker.debian.org/tracker/CVE-2026-41240
Vendor advisory: security-advisories@github.com — https://github.com/cure53/DOMPurify/security/advisories/GHSA-h7mw-gpvr-xq4m
Vendor advisory: security-advisories@github.com — https://github.com/cure53/DOMPurify/releases/tag/3.4.0
Vendor advisory: security-advisories@github.com — https://github.com/cure53/DOMPurify/commit/c361baa18dbdcb3344a41110f4c48ad85bf48f80
OS impact
| OS | Version | Status | Fixed in |
|---|---|---|---|
| debian | bookworm | affected | |
| debian | forky | fixed | 3.4.1+dfsg-1 |
| debian | sid | fixed | 3.4.1+dfsg-1 |
| debian | trixie | 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
Verify integrity in audit chain (admin only). AS-IS.