CVE Catalog

CVE-2026-41240

MediumCVSS 6.1
Published: Updated: Translated: NVD NIST

Exploitation Probability (EPSS)

Low risk
0.31%

24th percentile - higher than 24% of all known CVEs

Summary

DOMPurify versions prior to 3.4.0 have an inconsistency between FORBID_TAGS and FORBID_ATTR handling when function-based ADD_TAGS is used. When EXTRA_ELEMENT_HANDLING.tagCheck returns true, the FORBID_TAGS check is skipped entirely, allowing forbidden elements to survive sanitization with their attributes intact. Version 3.4.0 patches the issue.

Risk Assessment

This may allow bypassing HTML sanitization and conducting XSS attacks in applications using DOMPurify with this configuration. Organizations relying on this library to sanitize content are exposed to injection of malicious code.

Recommendation

Upgrade DOMPurify to version 3.4.0 or later. If upgrade is not possible, review ADD_TAGS and FORBID_TAGS configuration and limit use of function-based tagCheck.

Other vulnerabilities in DOMPurify

See all
Original NVD description (English source)

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.

Vulnerability data from NVD (NIST) · CISA KEV · EPSS