DOMPurify <=3.3.5: FORBID_TAGS/ATTR skip leads to XSS
CVE-2026-41240 Published on April 23, 2026

DOMPurify: FORBID_TAGS bypassed by function-based ADD_TAGS predicate (asymmetry with FORBID_ATTR fix)
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.

NVD

Weakness Types

What is an Allowlist / Allow List Vulnerability?

The product implements a protection mechanism that relies on a list of inputs (or properties of inputs) that are explicitly allowed by policy because the inputs are assumed to be safe, but the list is too permissive - that is, it allows an input that is unsafe, leading to resultant weaknesses.

CVE-2026-41240 has been classified to as an Allowlist / Allow List vulnerability or weakness.

What is a XSS Vulnerability?

The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.

CVE-2026-41240 has been classified to as a XSS vulnerability or weakness.


Products Associated with CVE-2026-41240

stack.watch emails you whenever new vulnerabilities are published in Cure53 Dompurify or Red Hat Kafka. Just hit a watch button to start following.

 
 

Affected Versions

cure53 DOMPurify Version < 3.4.0 is affected by CVE-2026-41240

Exploit Probability

EPSS
0.26%
Percentile
17.50%

EPSS (Exploit Prediction Scoring System) scores estimate the probability that a vulnerability will be exploited in the wild within the next 30 days. The percentile shows you how this score compares to all other vulnerabilities.