CVE-2026-41240

medium
Published 2026-04-23 · Modified 2026-05-05
CVSS v3
6.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
CVSS v2
VIR risk
6.1

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

Exploit likelihood
71%
Patch ETA

Heuristic predictions, AS-IS, for prioritization only.

Mitigations

vendor Authored 2026-05-27

Vendor advisory: debian — https://security-tracker.debian.org/tracker/CVE-2026-41240

vendor Authored 2026-05-27

Vendor advisory: security-advisories@github.com — https://github.com/cure53/DOMPurify/security/advisories/GHSA-h7mw-gpvr-xq4m

vendor Authored 2026-05-27

Vendor advisory: security-advisories@github.com — https://github.com/cure53/DOMPurify/releases/tag/3.4.0

vendor Authored 2026-05-27

Vendor advisory: security-advisories@github.com — https://github.com/cure53/DOMPurify/commit/c361baa18dbdcb3344a41110f4c48ad85bf48f80

OS impact

OSVersionStatusFixed in
debian debianbookwormaffected
debian debianforkyfixed3.4.1+dfsg-1
debian debiansidfixed3.4.1+dfsg-1
debian debiantrixieaffected

Package impact

EcosystemPackageVulnerableFixed
npm npmdompurify<3.4.03.4.0

Application impact

VendorProductVersionsFixed
cure53dompurify{"endExcluding":"3.4.0"}3.4.0

References

CWEs

CWE-79 CWE-183

Verify integrity in audit chain (admin only). AS-IS.