CVE-2025-29771
JSON

5.3medium

HtmlSanitizer vulnerable to XSS when used with contentEditable

Severity
5.3medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.40% (higher than 36% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-vhv4-fh94-jm5x

Description

HtmlSanitizer is a client-side HTML Sanitizer. Versions prior to 2.0.3 have a cross-site scripting vulnerability when the sanitizer is used with a `contentEditable` element to set the elements `innerHTML` to a sanitized string produced by the package. If the code is particularly crafted to abuse the code beautifier, that runs AFTER sanitation. The issue is patched in version 2.0.3.

Affected

Product or packageVersionsReported by
jitbit HtmlSanitizer< 2.0.3CVE List
@jitbit/htmlsanitizer (npm)before 2.0.3GitHub Advisory Database

All scores

GitHub_M5.3medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

Classification

CWE-79

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

HtmlSanitizer is a client-side HTML Sanitizer. Versions prior to 2.0.3 have a cross-site scripting vulnerability when the sanitizer is used with a `contentEditable` element to set the elements `innerHTML` to a sanitized string produced by the package. If the code is particularly crafted to abuse the code beautifier, that runs AFTER sanitation. The issue is patched in version 2.0.3.

GitHub Advisory Database
Impact

XSS vulnerability when the sanitizer is used with a contentEditable element to set the elements innerHTML to a sanitized string produced by the package. If the code is particularly crafted to abuse the code beautifier, that runs AFTER sanitation.

Patches

Patched in version 2.0.3

NVD (es)

HtmlSanitizer es un depurador de HTML del lado del cliente. Las versiones anteriores a la 2.0.3 presentan una vulnerabilidad de cross-site scripting cuando se usa con un elemento `contentEditable` para asignar los elementos `innerHTML` a una cadena depurada generada por el paquete. Si el código está manipulado específicamente para abusar del embellecedor de código, este se ejecuta DESPUÉS de la depuración. El problema se solucionó en la versión 2.0.3.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-29771 changed 2025-03-18CVE Terms of Use
GitHub Advisory DatabaseGHSA-vhv4-fh94-jm5x changed 2025-03-14CC-BY-4.0
NVDCVE-2025-29771 changed 2026-06-17Public domain