CVE-2019-9843: Improper Restriction of XML External Entity Reference in DiffPlug Spotless

Summary

05/07/2019
Yes i
High
7.5

CVE-2019-9843: Improper Restriction of XML External Entity Reference in DiffPlug Spotless. Affects com.diffplug.spotless:spotless-plugin-gradle versions < 3.20.0. Fixed in 3.20.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

DiffPlug Spotless is a library and set of plugins for Maven and Gradle that provides a convenient way to format and apply code style rules to various file types. It is commonly used in software development projects to enforce consistent code formatting. However, versions before 1.20.0 (Maven plugin) and 3.20.0 (Gradle plugin) suffer from an improper restriction of XML external entity reference vulnerability.

Vulnerability Detail

The XML parser used in DiffPlug Spotless resolves external entities over both HTTP and HTTPS, regardless of the resolveExternalEntities setting. This flaw allows an attacker to perform a man-in-the-middle (MITM) attack and potentially disclose the contents of files to the attacker. An attacker could exploit this vulnerability by tricking a victim into performing a spotlessApply operation on a malicious XML file.

How To Fix

Minimum fixed version

3.20.0

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is strongly advised to update to the fixed versions mentioned above.

Conclusion

The vulnerability in DiffPlug Spotless allows for improper restriction of XML external entity reference, potentially leading to disclosure of file contents to a MITM attacker. It is crucial to update to the fixed versions (1.20.0 or later for Maven plugin, 3.20.0 or later for Gradle plugin) to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for com.diffplug.spotless:spotless-plugin-gradle →

Share this vulnerability

FAQ

DiffPlug Spotless is a library and set of plugins for Maven and Gradle that provides code formatting and style enforcement capabilities.

An XML external entity reference is a feature that allows XML documents to include data from external sources. In this vulnerability, the XML parser resolves external entities over both HTTP and HTTPS, which can be exploited by an attacker.

A man-in-the-middle (MITM) attack is a type of cyber attack where an attacker intercepts and potentially alters communications between two parties without their knowledge. In this vulnerability, an attacker could perform a MITM attack to disclose file contents.

To update DiffPlug Spotless, you can use the package manager for your respective build tool (Maven or Gradle) and specify the updated version in your project configuration file (pom.xml or build.gradle).

Yes, you can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert provides real-time monitoring and alerts for open-source vulnerabilities without requiring access to the code or installation.

How To Fix

Minimum fixed version

3.20.0

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback