Vulnerabilities in pkg:maven/com.diffplug.spotless/spotless-maven-plugin
PACKAGECVE-2019-9843 is a HIGH (CVSS 7.5) improper restriction of xml external vulnerability (CWE-611: Improper Restriction of XML External Entity Reference) affecting Spotless plugin gradle libraries in the Maven ecosystem. The issue involves improper restriction of xml external entity reference in diffplug spotless. Remediation is available by upgrading affected packages to version 3.20.0, 1.20.0.
pkg:maven/com.diffplug.spotless/spotless-maven-plugin
Vulnerability advisories affecting package pkg:maven/com.diffplug.spotless/spotless-maven-plugin. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-7v35-qwwj-p98g | CVE-2019-9843 | HIGH | Improper Restriction of XML External Entity Reference in DiffPlug Spotless |
CVE-2019-9843 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2019-9843
To remediate this vulnerability, upgrade all affected Spotless plugin gradle 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>com.diffplug.spotless</groupId>
<artifactId>spotless-plugin-gradle</artifactId>
<version>3.20.0</version>
</dependency>
<dependency>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>1.20.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=com.diffplug.spotless
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2019-9843, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=com.diffplug.spotless
Analyze the terminal output to locate any version of Spotless plugin gradle in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.20.0), your application is affected.
Note: The mvn dependency:tree -Dincludes=com.diffplug.spotless 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 Spotless plugin gradle, 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-2019-9843 Affected Spotless plugin gradle Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
com.diffplug.spotless:spotless-plugin-gradle
|
Maven |
< 3.20.0
|
3.20.0
|
|
com.diffplug.spotless:spotless-maven-plugin
|
Maven |
< 1.20.0
|
1.20.0
|
References
Frequently Asked Questions
What is CVE-2019-9843?
Which Spotless plugin gradle versions are affected?
What version fixes CVE-2019-9843?
Is spotless-plugin-gradle affected?
Is spotless-maven-plugin affected?
What is the CVSS score of CVE-2019-9843?
What CWE is associated with CVE-2019-9843?
How can I check Maven dependencies for CVE-2019-9843?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7v35-qwwj-p98g",
"modified" : "2022-11-17T18:10:27Z",
"published" : "2019-07-05T21:07:40Z",
"aliases" : [ "CVE-2019-9843" ],
"summary" : "Improper Restriction of XML External Entity Reference in DiffPlug Spotless",
"details" : "In DiffPlug Spotless before 1.20.0 (library and Maven plugin) and before 3.20.0 (Gradle plugin), the XML parser would resolve external entities over both HTTP and HTTPS and didn't respect the resolveExternalEntities setting. For example, this allows disclosure of file contents to a MITM attacker if a victim performs a spotlessApply operation on an untrusted XML file.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "com.diffplug.spotless:spotless-plugin-gradle"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.20.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "com.diffplug.spotless:spotless-maven-plugin"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.20.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-9843"
}, {
"type" : "WEB",
"url" : "https://github.com/diffplug/spotless/issues/358"
}, {
"type" : "WEB",
"url" : "https://github.com/diffplug/spotless/pull/369"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/diffplug/spotless"
}, {
"type" : "WEB",
"url" : "https://github.com/diffplug/spotless/blob/master/plugin-gradle/CHANGES.md#version-3200---march-11th-2018-javadoc-jcenter"
}, {
"type" : "WEB",
"url" : "https://github.com/diffplug/spotless/blob/master/plugin-maven/CHANGES.md#version-1200---march-14th-2018-javadoc-jcenter"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-611" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2019-07-01T16:09:01Z",
"nvd_published_at" : "2019-06-28T18:15:00Z"
}
}