Vulnerabilities in pkg:maven/org.apache.sling/org.apache.sling.xss.compat
PACKAGECVE-2016-6798 is a CRITICAL (CVSS 9.8) xml external entity reference vulnerability (CWE-611: Improper Restriction of XML External Entity Reference) affecting Org.apache.sling.xss libraries in the Maven ecosystem. The issue involves xml external entity reference in apache sling. Remediation is available by upgrading affected packages to version 1.0.12, 1.1.0.
pkg:maven/org.apache.sling/org.apache.sling.xss.compat
Vulnerability advisories affecting package pkg:maven/org.apache.sling/org.apache.sling.xss.compat. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-7g54-vgp6-jj5w | CVE-2016-6798 | CRITICAL | XML External Entity Reference in Apache Sling |
| GHSA-xwf4-88xr-hx2j | CVE-2016-5394 | MODERATE | Cross site scripting in Apache Sling |
| GHSA-7mfw-43c4-45mq | CVE-2017-15717 | MODERATE | Cross-site Scripting in Apache Sling XSS Protection API |
CVE-2016-6798 at a Glance
Security Impact
CVSS: 9.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2016-6798
To remediate this vulnerability, upgrade all affected Org.apache.sling.xss dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.xss</artifactId>
<version>1.0.12</version>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.xss.compat</artifactId>
<version>1.1.0</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.apache.sling
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2016-6798, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.apache.sling
Analyze the terminal output to locate any version of Org.apache.sling.xss in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.12), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.apache.sling command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-611: Improper Restriction of XML External Entity Reference, where the product processes an xml document that can contain xml entities with uris that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output. In Org.apache.sling.xss, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2016-6798 Affected Org.apache.sling.xss Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.apache.sling:org.apache.sling.xss
|
Maven |
< 1.0.12
|
1.0.12
|
|
org.apache.sling:org.apache.sling.xss.compat
|
Maven |
< 1.1.0
|
1.1.0
|
References
Frequently Asked Questions
What is CVE-2016-6798?
Which Org.apache.sling.xss versions are affected?
What version fixes CVE-2016-6798?
Is org.apache.sling.xss affected?
Is org.apache.sling.xss.compat affected?
What is the CVSS score of CVE-2016-6798?
What CWE is associated with CVE-2016-6798?
How can I check Maven dependencies for CVE-2016-6798?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7g54-vgp6-jj5w",
"modified" : "2022-11-03T20:48:21Z",
"published" : "2022-05-17T02:26:22Z",
"aliases" : [ "CVE-2016-6798" ],
"summary" : "XML External Entity Reference in Apache Sling",
"details" : "In the XSS Protection API module before 1.0.12 in Apache Sling, the method XSS.getValidXML() uses an insecure SAX parser to validate the input string, which allows for XXE attacks in all scripts which use this method to validate user input, potentially allowing an attacker to read sensitive data on the filesystem, perform same-site-request-forgery (SSRF), port-scanning behind the firewall or DoS the application.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.sling:org.apache.sling.xss"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.0.12"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.sling:org.apache.sling.xss.compat"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.1.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-6798"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/sling-org-apache-sling-xss/commit/de32b144ad2be3367559f6184d560db42a220529"
}, {
"type" : "WEB",
"url" : "https://github.com/jensdietrich/xshady-release/tree/main/CVE-2016-6798"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread.html/b72c3a511592ec70729b3ec2d29302b6ce87bbeab62d4745617a6bd0@%3Cdev.sling.apache.org%3E"
}, {
"type" : "WEB",
"url" : "http://www.securityfocus.com/bid/99873"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-611" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2022-11-03T20:48:21Z",
"nvd_published_at" : "2017-07-19T15:29:00Z"
}
}