VYPR
High severityNVD Advisory· Published Jul 13, 2021· Updated Aug 4, 2024

Apache Commons Compress 1.6 to 1.20 denial of service vulnerability

CVE-2021-35516

Description

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. This could be used to mount a denial of service attack against services that use Compress' sevenz package.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Apache Commons Compress 1.6 to 1.20 can be forced to allocate excessive memory when reading a crafted 7Z archive, leading to denial of service.

Vulnerability

When reading a specially crafted 7Z archive, the SevenZFile class in Apache Commons Compress versions 1.6 through 1.20 can be made to allocate large amounts of memory, resulting in an out-of-memory error even for very small inputs [1]. The issue is tracked as COMPRESS-542 [2]. The vulnerability is present in the sevenz package.

Exploitation

An attacker needs to provide a malicious 7Z archive to a service that uses the SevenZFile class. No authentication or special privileges are required; the attacker only needs to supply the crafted archive. Starting with Compress 1.19, a feature to recover broken 7z archives was introduced, which makes exploitation far easier because the recovery code triggers the excessive memory allocation [2]. The attacker does not need to interact further after the archive is processed.

Impact

Successful exploitation leads to a denial of service (DoS) condition. The service consuming the archive will exhaust available memory and crash or become unresponsive. The impact is limited to availability; no data confidentiality or integrity is compromised.

Mitigation

Users should upgrade to Apache Commons Compress 1.21 or later, which contains the fix [2]. For users unable to upgrade, the recovery feature introduced in 1.19 can be disabled by not enabling it explicitly. Additionally, users can control the amount of memory SevenZFile may use via configuration options [2]. No workaround is available for versions prior to 1.19.

AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
org.apache.commons:commons-compressMaven
< 1.211.21

Affected products

7

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

31

News mentions

0

No linked articles in our index yet.