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
No i
High
7.5

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 >= c49e865f4eabd47e264063499e27e12eb549feb1, <= f7503adfbad8b44eb079d564f2784aeaa034647c. No fix is published. 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

libcommons-compress-java is a Java library that provides support for reading and writing various compressed file formats, including ZIP, TAR, and 7Z. It is widely used in applications that require file compression and decompression functionalities. The library is essential for developers looking to integrate compression features into their Java applications. However, a vulnerability has been identified that affects its handling of specially crafted 7Z archives, which can lead to significant performance issues.

Vulnerability Detail

The vulnerability, identified as CVE-2021-35515, arises when the libcommons-compress-java library processes a specially crafted 7Z archive. The construction of the list of codecs that decompress an entry can enter an infinite loop, leading to a denial of service (DoS) condition. This vulnerability can be exploited by an attacker who sends a maliciously crafted 7Z file to a service using the library, potentially causing the service to become unresponsive. The severity of this vulnerability is reflected in its CVSS score of 7.5, indicating a high risk to affected systems.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

If upgrading is not immediately possible, a temporary workaround is to avoid processing untrusted or unknown 7Z archives until the library is updated. Additionally, implementing input validation to check the integrity and source of the 7Z files before processing can help mitigate the risk.

Conclusion

CVE-2021-35515 represents a significant risk to applications using the libcommons-compress-java library, particularly in how they handle 7Z archives. Upgrading to the latest version is crucial to mitigate this vulnerability and ensure the stability and security of your applications.

See every vulnerability recorded for libcommons-compress-java →

Share this vulnerability

FAQ

CVE-2021-35515 is a vulnerability in the libcommons-compress-java library that can lead to a denial of service due to an infinite loop when processing specially crafted 7Z archives.

You can use Vulert, which monitors open-source vulnerabilities in your software. Simply upload your manifest file like package-lock.json to check for vulnerabilities.

Exploitation of this vulnerability can lead to service downtime, as the application may become unresponsive when processing malicious 7Z files.

Yes, you can avoid processing untrusted 7Z archives and implement input validation to check the integrity of the files before processing.

The CVSS score for CVE-2021-35515 is 7.5, indicating a high severity level.

Related vulnerabilities

Recent vulnerabilities recorded for libcommons-compress-java.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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