CVE-2026-41240

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

Configuration 1 (hide)

cpe:2.3:a:cure53:dompurify:*:*:*:*:*:*:*:*

History

26 Oct 2026, 21:10

Type Values Removed Values Added
Summary
  • (es) DOMPurify es un saneador de cross-site scripting solo para DOM para HTML, MathML y SVG. Las versiones anteriores a la 3.4.0 tienen una inconsistencia entre el manejo de FORBID_TAGS y FORBID_ATTR cuando se utiliza ADD_TAGS basado en funciones. El commit c361baa añadió una salida temprana para FORBID_ATTR en la línea 1214. La misma corrección no se aplicó a FORBID_TAGS. En las líneas 1118-1123, cuando EXTRA_ELEMENT_HANDLING.tagCheck devuelve true, la evaluación de cortocircuito omite completamente la verificación de FORBID_TAGS. Esto permite que los elementos prohibidos sobrevivan a la sanitización con sus atributos intactos. La versión 3.4.0 corrige el problema.

Information

Published : 2026-04-23 16:16

Updated : 2026-10-26 21:10


NVD link : CVE-2026-41240

Mitre link : CVE-2026-41240

CVE.ORG link : CVE-2026-41240


JSON object : View

Products Affected

cure53

  • dompurify
CWE
CWE-79

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

CWE-183

Permissive List of Allowed Inputs