CVE-2019-10782: Checkstyle XML External Entity (XXE) Processing Vulnerability

MODERATE
Advisory Identifier: GHSA-763g-fqq7-48wg
CVSS 5.3
CWE-611
Published
Advisory Summary

CVE-2019-10782 is a MODERATE (CVSS 5.3) xml external entity (xxe) processing vulnerability (CWE-611: Improper Restriction of XML External Entity Reference) affecting Checkstyle libraries in the Maven ecosystem. The issue involves xml external entity (xxe) processing ('external-parameter-entities' feature was not fully disabled)). Remediation is available by upgrading affected packages to version 8.29.

CVE-2019-10782 at a Glance

CVE Identifier CVE-2019-10782
GHSA Identifier GHSA-763g-fqq7-48wg
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-611: Improper Restriction of XML External Entity Reference
Affected Product Checkstyle
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2019-10782

To remediate this vulnerability, upgrade all affected Checkstyle dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

com.puppycrawl.tools:checkstyle fixed: 8.29
<dependency>
    <groupId>com.puppycrawl.tools</groupId>
    <artifactId>checkstyle</artifactId>
    <version>8.29</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=com.puppycrawl.tools

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2019-10782, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=com.puppycrawl.tools

Analyze the terminal output to locate any version of Checkstyle in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.29), your application is affected.

Note: The mvn dependency:tree -Dincludes=com.puppycrawl.tools 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 Checkstyle, 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

Due to an incomplete fix for [CVE-2019-9658](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-9658), checkstyle was still vulnerable to XML External Entity (XXE) Processing. ### Impact #### User: Build Maintainers This vulnerability probably doesn't impact Maven/Gradle users as, in most cases, these builds are processing files that are trusted, or pre-vetted by a pull request reviewer before being run on internal CI infrastructure. #### User: Static Analysis as a Service If you operate a site/service that parses "untrusted" Checkstyle XML configuration files, you are vulnerable to this and should patch. Note from the discoverer of the original CVE-2019-9658: > While looking at a few companies that run Checkstyle/PMD/ect... as a service I notice that it's a common pattern to run the static code analysis tool inside of a Docker container with the following flags: > ``` > --net=none \ > --privileged=false \ > --cap-drop=ALL > ``` > Running the analysis in Docker has the advantage that there should be no sensitive local file information that XXE can exfiltrate from the container. Additionally, these flags prevent vulnerabilities in static analysis tools like Checkstyle from being used to exfiltrate data via XXE or to perform SSRF. > \- [Jonathan Leitschuh](https://twitter.com/jlleitschuh) ### Patches _Has the problem been patched? What versions should users upgrade to?_ Patched, will be released with version 8.29 at 26 Jan 2020. ### Workarounds _Is there a way for users to fix or remediate the vulnerability without upgrading?_ No workaround are available ### References - [CWE-611: Improper Restriction of XML External Entity Reference](https://cwe.mitre.org/data/definitions/611.html) - GitHub Issue https://github.com/checkstyle/checkstyle/issues/7468 ### For more information If you have any questions or comments about this advisory: * Open an issue in https://github.com/checkstyle/checkstyle/issues

CVE-2019-10782 Affected Checkstyle Versions

1 component(s)
Fixed Versions:
8.29
Product / Package Ecosystem Affected Versions Fixed Version
com.puppycrawl.tools:checkstyle
Maven
< 8.29
8.29

References

Frequently Asked Questions

What is CVE-2019-10782?
CVE-2019-10782 is a security vulnerability in Checkstyle involving XML external entity (XXE) processing ('external-parameter-entities' feature was not fully disabled)) under CWE-611: Improper Restriction of XML External Entity Reference.
Which Checkstyle versions are affected?
Affected versions include releases prior to 8.29 across affected packages: com.puppycrawl.tools:checkstyle.
What version fixes CVE-2019-10782?
Upgrading to 8.29 (or the latest patched release for your respective branch) resolves the vulnerability.
Is checkstyle affected?
Yes, com.puppycrawl.tools:checkstyle is affected in releases prior to 8.29. Upgrade your dependency to 8.29 or later.
What is the CVSS score of CVE-2019-10782?
CVE-2019-10782 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2019-10782?
CVE-2019-10782 is classified under CWE-611: Improper Restriction of XML External Entity Reference (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.).
How can I check Maven dependencies for CVE-2019-10782?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=com.puppycrawl.tools'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-763g-fqq7-48wg",
  "modified" : "2021-08-19T16:49:30Z",
  "published" : "2020-01-31T18:00:07Z",
  "aliases" : [ "CVE-2019-10782" ],
  "summary" : "XML external entity (XXE) processing ('external-parameter-entities' feature was not fully disabled))",
  "details" : "Due to an incomplete fix for [CVE-2019-9658](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-9658), checkstyle was still vulnerable to XML External Entity (XXE) Processing.\n\n### Impact\n\n#### User: Build Maintainers\n\nThis vulnerability probably doesn't impact Maven/Gradle users as, in most cases, these builds are processing files that are trusted, or pre-vetted by a pull request reviewer before being run on internal CI infrastructure.\n\n#### User: Static Analysis as a Service\n\nIf you operate a site/service that parses \"untrusted\" Checkstyle XML configuration files, you are vulnerable to this and should patch.\n\nNote from the discoverer of the original CVE-2019-9658:\n\n> While looking at a few companies that run Checkstyle/PMD/ect... as a service I notice that it's a common pattern to run the static code analysis tool inside of a Docker container with the following flags:\n> ```\n> --net=none \\\n> --privileged=false \\\n> --cap-drop=ALL\n> ```\n> Running the analysis in Docker has the advantage that there should be no sensitive local file information that XXE can exfiltrate from the container. Additionally, these flags prevent vulnerabilities in static analysis tools like Checkstyle from being used to exfiltrate data via XXE or to perform SSRF.\n> \\- [Jonathan Leitschuh](https://twitter.com/jlleitschuh)\n\n### Patches\n_Has the problem been patched? What versions should users upgrade to?_\n\nPatched, will be released with version 8.29 at 26 Jan 2020.\n\n### Workarounds\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\nNo workaround are available\n\n### References\n\n - [CWE-611: Improper Restriction of XML External Entity Reference](https://cwe.mitre.org/data/definitions/611.html)\n - GitHub Issue https://github.com/checkstyle/checkstyle/issues/7468\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an issue in https://github.com/checkstyle/checkstyle/issues\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "com.puppycrawl.tools:checkstyle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "8.29"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/checkstyle/checkstyle/security/advisories/GHSA-763g-fqq7-48wg"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-10782"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/checkstyle/checkstyle/issues/7468"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/checkstyle/checkstyle/commit/c46a16d177e6797895b195c288ae9a9a096254b8"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r8aaf4ee16bbaf6204731d4770d96ebb34b258cd79b491f9cdd7f2540@%3Ccommits.nifi.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2020/02/msg00008.html"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JAVA-COMPUPPYCRAWLTOOLS-543266"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-611" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-01-31T17:58:17Z",
    "nvd_published_at" : null
  }
}