Cross site scripting in Apache Sling
In the XSS Protection API module before 1.0.12 in Apache Sling, the encoding done by the XSSAPI.encodeForJSString() method is not restrictive enough and for some input patterns allows script tags to pass through unencoded, leading to potential XSS vulnerabilities.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Java / Kotlin (Maven) | org.apache.sling:org.apache.sling.xss | < 1.0.12 | 1.0.12 |
| Java / Kotlin (Maven) | org.apache.sling:org.apache.sling.xss.compat | < 1.1.0 | 1.1.0 |
References
- https://nvd.nist.gov/vuln/detail/CVE-2016-5394
- https://github.com/apache/sling-org-apache-sling-xss/commit/de32b144ad2be3367559f6184d560db42a220529
- https://github.com/jensdietrich/xshady-release/tree/main/CVE-2016-5394
- https://lists.apache.org/thread.html/332166037a54b97cf41e2b616aaed38439de94b19b204841478e4525@%3Cdev.sling.apache.org%3E
- http://www.securityfocus.com/bid/99870
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N- Weakness (CWE)
CWE-79- Platform
- Java / Kotlin (Maven)
- Package
org.apache.sling:org.apache.sling.xss, org.apache.sling:org.apache.sling.xss.compat- Disclosed
- 13.05.2022
- Updated
- 11.10.2026 11:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-xwf4-88xr-hx2j - CC BY 4.0
Vulnerability history: org.apache.sling:org.apache.sling.xss.compat
All published vulnerabilities of this package (Java / Kotlin (Maven)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 3
- First → latest
- 05.2022 05.2022
- Without a fix
- 1
- Exploited in attacks
- 0
Severity breakdown
- Critical 1
- Medium 2
Disclosures per year
- 2022: 3
- 2023: 0
- 2024: 0
- 2025: 0
- 2026: 0
-
Cross site scripting in Apache Sling this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.