CVE-2021-42575 — owasp-java-html-sanitizer
CRITICALCVE-2021-42575 is a critical-severity (CVSS 9.8) vulnerability in com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer. 1 public exploit reference exists, so weaponization risk is real. A fix is available for com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer — see the affected versions and patch details below.
Policies not properly enforced in OWASP Java HTML Sanitizer
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2021-42575 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 385,987 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizerReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Maven packages — download data is not available via public APIs for these ecosystems.
Description
The OWASP Java HTML Sanitizer before 20211018.1 does not properly enforce policies associated with the SELECT, STYLE, and OPTION elements.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| ☕Maven | com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer | all versions | 20211018.1com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:20211018.1 |
Affected Products
middleware common libraries and toolsoracleprimavera unifieroraclejava html sanitizerowaspResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer to 20211018.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-42575 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Single Sign-On 7.6.1 | see advisory | RHSA-2022:7417 |
| Red Hat Single Sign-On 7.6 for RHEL 7 | rh-sso7-keycloak-0:18.0.3-1.redhat_00001.1.el7sso | RHSA-2022:7409 |
| Red Hat Single Sign-On 7.6 for RHEL 8 | rh-sso7-keycloak-0:18.0.3-1.redhat_00001.1.el8sso | RHSA-2022:7410 |
| Red Hat Single Sign-On 7.6 for RHEL 9 | rh-sso7-0:1-5.el9sso | RHSA-2022:7411 |
Frequently Asked Questions
Is CVE-2021-42575 in your dependencies?
Find it across Maven, including transitive dependencies.