CVE-2025-26791
JavaScript vulnerability analysis and mitigation

Overview

DOMPurify before version 3.2.4 contains a cross-site scripting vulnerability due to an incorrect template literal regular expression. The vulnerability was discovered and disclosed on February 14, 2025, affecting the DOMPurify library, a popular HTML sanitizer (NVD, MITRE).

Technical details

The vulnerability stems from an incorrect template literal regular expression that can lead to mutation cross-site scripting (mXSS) when specific configurations are used. The issue specifically occurs when the SAFEFORTEMPLATES option is enabled along with custom element handling. The vulnerability involves a combination of mXSS and comments in attribute values, allowing attackers to bypass DOMPurify's sanitization mechanisms. The CVSS v3.1 base score is 4.5 (Medium) with a vector of CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N (DOMPurify Bypass).

Impact

When successfully exploited, this vulnerability could allow attackers to execute cross-site scripting attacks by bypassing DOMPurify's sanitization mechanisms. The impact is particularly relevant when using non-default configurations with the SAFEFORTEMPLATES option enabled (DOMPurify Release).

Mitigation and workarounds

The vulnerability has been fixed in DOMPurify version 3.2.4. The fix involves changing the template literal regex to prevent the config-dependent bypass. Users are advised to upgrade to version 3.2.4 or later to address this security issue (DOMPurify Commit).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management