CVE-2021-23899 is a critical-severity (CVSS 9.8) XML External Entity (XXE) vulnerability in com.mikesamuel:json-sanitizer. A fix is available for com.mikesamuel:json-sanitizer — see the affected versions and patch details below.
Arbitrary code injection in json-sanitizer
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
com.mikesamuel:json-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
OWASP json-sanitizer before 1.2.2 may emit closing SCRIPT tags and CDATA section delimiters for crafted input. This allows an attacker to inject arbitrary HTML or XML into embedding documents.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| ☕Maven | com.mikesamuel:json-sanitizer | all versions | 1.2.2com.mikesamuel:json-sanitizer:1.2.2 |
Affected Products
json-sanitizerowaspDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for com.mikesamuel:json-sanitizer, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update com.mikesamuel:json-sanitizer to 1.2.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-23899 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.
Frequently Asked Questions
Is CVE-2021-23899 in your dependencies?
Find it across Maven, including transitive dependencies.