DOM-Based Cross-Site Scripting Vulnerability in DOMPurify
CVE-2026-41240
6MEDIUM
What is CVE-2026-41240?
DOMPurify, a popular DOM-only HTML sanitizer, exhibits a significant flaw in its handling of FORBID_TAGS and FORBID_ATTR when using function-based ADD_TAGS. In versions before 3.4.0, an inconsistency allows prohibited elements to bypass sanitization. Specifically, due to an early exit implemented for attribute checking, the absence of a similar fix for tag checking leads to the retention of forbidden elements along with their attributes in sanitized output. Users are encouraged to upgrade to version 3.4.0, which addresses this critical sanitation issue.
Affected Version(s)
DOMPurify < 3.4.0
