CVE-2025-29771
JavaScript vulnerability analysis and mitigation

Overview

HtmlSanitizer, a client-side HTML Sanitizer, was found to contain a cross-site scripting (XSS) vulnerability in versions prior to 2.0.3. The vulnerability was discovered on March 14, 2025, and affects scenarios where the sanitizer is used with a contentEditable element to set the elements innerHTML to a sanitized string produced by the package (NVD, GitHub Advisory).

Technical details

The vulnerability stems from the code beautifier that runs after the sanitization process. When specifically crafted code is used to abuse the beautifier functionality, it can bypass the intended sanitization protections. The issue has been assigned a CVSS 4.0 Base Score of 5.3 (Medium) with the vector string CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N and is classified under CWE-79 (Improper Neutralization of Input During Web Page Generation) (NVD).

Impact

The vulnerability could allow attackers to execute cross-site scripting attacks when the sanitizer is used in conjunction with contentEditable elements. This could potentially lead to unauthorized script execution in the context of the affected web application (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in HtmlSanitizer version 2.0.3. Users are advised to upgrade to this version or later to address the security issue. The fix involved removing the beautification process that was introducing the attack vector (GitHub Commit).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-23947CRITICAL9.3
  • JavaScriptJavaScript
  • @orval/core
NoYesJan 20, 2026
CVE-2026-23950HIGH8.8
  • JavaScriptJavaScript
  • grafana-graphite
NoYesJan 20, 2026
CVE-2026-22037HIGH8.4
  • JavaScriptJavaScript
  • @fastify/express
NoYesJan 19, 2026
CVE-2026-23522LOW3.7
  • JavaScriptJavaScript
  • @lobehub/chat
NoNoJan 19, 2026
CVE-2025-66803LOW1.7
  • JavaScriptJavaScript
  • @hotwired/turbo
NoYesJan 20, 2026

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