CVE-2026-41240 DOMPurify: FORBID_TAGS bypassed by function-based ADD_TAGS predicate (asymmetry with FORBID_ATTR fix)

Medium 6.0 Published Updated

DOMPurify fails to enforce FORBID_TAGS when function-based ADD_TAGS is used, allowing XSS via forbidden elements.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-41240?

CVE-2026-41240 is a medium-severity cross-site scripting vulnerability in cure53 DOMPurify, published on 23 Apr 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official 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.

Weakness: CWE-79, CWE-183

Which versions are affected by CVE-2026-41240?

2 open source packages ship an affected version, including dompurify. It affects 1 product.

PackageAffectedFixed in
dompurify npmAll versions3.4.0
dompurify npmAll versions3.4.0
Linux distribution packages (1)
argocd-cli openSUSE:TumbleweedAll versions3.4.3-1.1

Products include Cure53 Dompurify.

How do I fix CVE-2026-41240?

Upgrade dompurify to 3.4.0 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2026-41240 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-41240 exists.

Sources

Also known as CLEANSTART-2026-PO95463, CLEANSTART-2026-SE92910, DEBIAN-CVE-2026-41240, ECHO-a5a3-4e39-a94b, GHSA-h7mw-gpvr-xq4m, MINI-42pm-x8wv-jhvm and 13 more.

Is CVE-2026-41240 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free