Denial of Service Vulnerability in libcommons-compress-java: Infinite Loop in 7Z Archive Handling

libcommons-compress-java Updated 02 Oct 2025

Summary

13/07/2021
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2021-35515: When reading a specially crafted 7Z archive, the construction of the list of codecs that decompress an entry can result in an infinite loop. Affects libcommons-compress-java versions < 1.21-1. Fixed in 1.21-1. 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 Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

libcommons-compress-java is a Java library that provides support for reading and writing various archive formats, including ZIP, TAR, and 7Z. It is widely used in applications that require file compression and decompression functionalities. The library's handling of 7Z archives is crucial for ensuring that applications can manage compressed files effectively. However, a vulnerability has been identified that could lead to service disruptions when processing specially crafted 7Z files.

Vulnerability Detail

The vulnerability, identified as DEBIAN-CVE-2021-35515, arises from the way libcommons-compress-java processes certain 7Z archives. When the library encounters a specially crafted archive, it can enter an infinite loop while constructing the list of codecs necessary for decompressing an entry. This behavior can be exploited to mount a denial of service (DoS) attack, potentially rendering services that rely on this library unresponsive. The issue is significant as it affects the stability and availability of applications using the library, especially in environments where 7Z files are common.

How To Fix

Minimum fixed version

1.21-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 workaround, avoid processing untrusted or unknown 7Z archives until the package is updated. Additionally, implement input validation to check the integrity of 7Z files before processing them.

Conclusion

The vulnerability in libcommons-compress-java poses a significant risk to applications that handle 7Z archives, potentially leading to denial of service. It is crucial to update to the patched version to mitigate this risk. Users are encouraged to monitor their applications for vulnerabilities using tools like Vulert.

See every vulnerability recorded for libcommons-compress-java →

Share this vulnerability

FAQ

The vulnerability allows for an infinite loop when processing specially crafted 7Z archives, leading to potential denial of service.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Check your application against this vulnerability using the Vulert playground at Vulert Scanner.

Versions prior to 1.21-1 are affected by this vulnerability.

Yes, updating to version 1.21-1 or later will resolve the vulnerability.

If immediate updates are not possible, avoid processing untrusted 7Z files and implement input validation as a temporary measure.

Related vulnerabilities

Recent vulnerabilities recorded for libcommons-compress-java.

How To Fix

Minimum fixed version

1.21-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 →

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