CVE-2016-5394 Cross site scripting in Apache Sling
Insufficient encoding in Apache Sling XSS API allows script tags to bypass filters, enabling cross-site scripting attacks.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2016-5394?
CVE-2016-5394 is a medium-severity cross-site scripting vulnerability in Apache Sling, published on 19 Jul 2017. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
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.
Weakness: CWE-79
Which versions are affected by CVE-2016-5394?
4 open source packages ship an affected version, including org.apache.sling:org.apache.sling.xss and org.apache.sling:org.apache.sling.xss.compat. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
org.apache.sling:org.apache.sling.xss Maven | All versions | 1.0.12 |
org.apache.sling:org.apache.sling.xss Maven | All versions | 1.0.12 |
org.apache.sling:org.apache.sling.xss.compat Maven | All versions | 1.1.0 |
org.apache.sling:org.apache.sling.xss.compat Maven | All versions | 1.1.0 |
Products include Apache Sling.
How do I fix CVE-2016-5394?
Upgrade org.apache.sling:org.apache.sling.xss to 1.0.12 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2016-5394 being exploited?
There is no known exploitation of CVE-2016-5394 in the wild and no public exploit code.
Public exploit code: 2 proofs of concept on GitHub.
Other vulnerabilities in Apache Sling
Sources
Also known as GHSA-xwf4-88xr-hx2j.