Denial of Service Vulnerability in Apache Commons Compress: libcommons-compress-java
Summary
DEBIAN-CVE-2012-2098: Algorithmic complexity vulnerability in the sorting algorithms in bzip2 compressing stream (BZip2CompressorOutputStream) in Apache Commons Compress before 1.4.1 allows remote attackers to cause a denial of service (CPU c... Affects libcommons-compress-java versions < 1.4.1-1. Fixed in 1.4.1-1. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
libcommons-compress-java is a Java library that provides support for reading and writing various compression formats, including ZIP, TAR, and BZip2. It is widely used in applications that require file compression and decompression functionalities. However, prior to version 1.4.1, the library contained an algorithmic complexity vulnerability in its sorting algorithms, specifically within the BZip2 compressing stream, which could be exploited by attackers.
Vulnerability Detail
The vulnerability, identified as DEBIAN-CVE-2012-2098, arises from the sorting algorithms in the BZip2CompressorOutputStream of Apache Commons Compress. This flaw allows remote attackers to craft a file with many repeating inputs, leading to excessive CPU consumption and potential denial of service. The issue is rooted in the inefficient handling of specific input patterns, which can cause the application to hang or crash under certain conditions.
How To Fix
Minimum fixed version
1.4.1-1
This is the first release that contains the fix.
sudo apt-get install --only-upgrade libcommons-compress-java
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary measure, you can avoid processing files that are suspected to contain many repeating inputs until the package is updated. Additionally, implementing input validation to filter out potentially harmful files may help mitigate the risk.
Conclusion
The DEBIAN-CVE-2012-2098 vulnerability in libcommons-compress-java poses a significant risk of denial of service due to inefficient handling of specific input patterns. It is crucial to update to version 1.4.1-1 or later to mitigate this risk. Temporary workarounds can be employed until the update is applied.
See every vulnerability recorded for libcommons-compress-java →
FAQ
The vulnerability is an algorithmic complexity issue that can lead to denial of service due to excessive CPU consumption when processing specially crafted files.
All versions prior to 1.4.1 are affected by this vulnerability.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
If immediate updates are not possible, consider implementing input validation to filter out potentially harmful files as a temporary workaround.
Yes, Vulert provides a service that monitors and alerts for open-source vulnerabilities in your software using just a manifest file like package-lock.json.
References
Related vulnerabilities
Recent vulnerabilities recorded for libcommons-compress-java.