Denial of Service Vulnerability in libcommons-compress-java: Memory Allocation Issue

libcommons-compress-java Updated 02 Oct 2025

Summary

13/07/2021
N/A
No i
High
7.5

CVE-2021-35516: When reading a specially crafted 7Z archive, Compress can be made to allocate large amounts of memory that finally leads to an out of memory error even for very small inputs. 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 compression formats, including 7Z, ZIP, and TAR. It is widely used in applications that require file compression and decompression functionalities. The library is designed to handle large files efficiently, but it has a vulnerability that can be exploited to cause excessive memory allocation, leading to denial of service (DoS) attacks.

Vulnerability Detail

The vulnerability, identified as CVE-2021-35516, arises when the Compress library processes specially crafted 7Z archives. Attackers can exploit this flaw to trigger large memory allocations, resulting in an out-of-memory error even when processing small inputs. This can effectively disrupt services that rely on the Compress library, making them unavailable to legitimate users. The vulnerability has a CVSS score of 7.5, indicating a high severity level.

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 immediate upgrading is not feasible, consider implementing input validation to restrict the types of 7Z archives that can be processed by your application. This can help mitigate the risk of exploitation until the library is updated.

Conclusion

CVE-2021-35516 is a significant vulnerability in the libcommons-compress-java library that can lead to denial of service through excessive memory allocation. It is crucial to update the library to the latest version to mitigate this risk. Utilizing tools like Vulert can help monitor and manage vulnerabilities effectively.

See every vulnerability recorded for libcommons-compress-java →

Share this vulnerability

FAQ

CVE-2021-35516 is a vulnerability in the libcommons-compress-java library that allows attackers to exploit memory allocation issues when processing specially crafted 7Z archives.

Exploitation of this vulnerability can lead to denial of service, making your application unavailable to users due to excessive memory consumption.

The CVSS score of CVE-2021-35516 is 7.5, indicating a high severity level.

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

Implement input validation to restrict the types of 7Z archives processed by your application as a temporary workaround until you can upgrade.

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