CVE-2025-66021: OWASP Java HTML Sanitizer is vulnerable to XSS via noscript tag and improper style tag sanitization
CVE-2025-66021 · Severity: medium · CVSS 6.1 · Published 2025-11-26
OWASP Java HTML Sanitizer is a configureable HTML Sanitizer written in Java, allowing inclusion of HTML authored by third-parties in web applications while protecting against XSS. In version 20240325.1, OWASP java html sanitizer is vulnerable to XSS if HtmlPolicyBuilder allows noscript and style tags with allowTextIn inside the style tag. This could lead to XSS if the payload is crafted in such a way that it does not sanitise the CSS and allows tags which is not mentioned in HTML policy. At time of publication no known patch is available.
Yes. com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer (Maven): upgrade to 20260101.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
Am I affected by CVE-2025-66021?
Check whether you run com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer (Maven) or OWASP Java Html Sanitizer at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
How to fix
com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer (Maven): upgrade to 20260101.1 or later
# set com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer to 20260101.1 in your pom.xml or build.gradle