Apache Commons Compress: Denial of service via CPU consumption for malformed TAR file
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Partial Red Hat: 3 without a fix
Attack profile from CVSS 3.1 · NVD. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-400.
Summary
Improper Input Validation, Uncontrolled Resource Consumption vulnerability in Apache Commons Compress in TAR parsing.This issue affects Apache Commons Compress: from 1.22 before 1.24.0. Users are recommended to upgrade to version 1.24.0, which fixes the issue. A third party can create a malformed TAR file by manipulating file modification times headers, which when parsed with Apache Commons Compress, will cause a denial of service issue via CPU consumption. In version 1.22 of Apache Commons Compress, support was added for file modification times with higher precision (issue # COMPRESS-612 [1]). The format for the PAX extended headers carrying this data consists of two numbers separated by a period [2], indicating seconds and subsecond precision (for example “1647221103.5998539”). The impacted fields are “atime”, “ctime”, “mtime” and “LIBARCHIVE.creationtime”. No input validation is performed prior to the parsing of header values. Parsing of these numbers uses the BigDecimal [3] class from the JDK which has a publicly known algorithmic complexity issue when doing operations on large numbers, causing denial of service (see issue # JDK-6560193 [4]). A third party can manipulate file time headers in a TAR file by placing a number with a very long fraction (300,000 digits) or a number with exponent notation (such as “9e9999999”) within a file modification time header, and the parsing of files with these headers will take hours instead of seconds, leading to a denial of service via exhaustion of CPU resources. This issue is similar to CVE-2012-2098 [5]. [1]: https://issues.apache.org/jira/browse/COMPRESS-612 [2]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_05 [3]: https://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html [4]: https://bugs.openjdk.org/browse/JDK-6560193 [5]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-2098 Only applications using CompressorStreamFactory class (with auto-detection of file types), TarArchiveInputStream and TarFile classes to parse TAR files are impacted. Since this code was introduced in v1.22, only that version and later versions are impacted.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Apache | Apache Commons Compress | 1.22 to before 1.24.0 | 1.24.0 | Patch available | CNA |
| — | org.apache.commons:commons-compress (Maven) | 1.22 to before 1.24.0 | 1.24.0 | Patch available | GHSA-cgwf-w82q-5jrr |
- Apache Commons Compress VendorApache Affected 1.22 to before 1.24.0 Fixed in 1.24.0 Patch available CNA
- org.apache.commons:commons-compress (Maven) Vendor— Affected 1.22 to before 1.24.0 Fixed in 1.24.0 Patch available GHSA-cgwf-w82q-5jrr
Remediation
- Fix · CNA Apache Commons Compress (Apache Software Foundation) Fixed in 1.24.0
- Fix · GHSA-cgwf-w82q-5jrr org.apache.commons:commons-compress (Maven) Fixed in 1.24.0 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Integration Camel K 1 | Affected | No fix planned: Will not fix |
| Red Hat Process Automation 7 | Affected | No fix planned: Out of support scope |
| Red Hat Single Sign-On 7 | Affected | No fix planned: Out of support scope |
Not affected: 7 products
- Red Hat Build of Keycloak
- Red Hat Data Grid 8
- Red Hat Fuse 7
- Red Hat build of Apache Camel 4 for Quarkus 3
- Red Hat build of Apicurio Registry 2
- Red Hat build of OptaPlanner 8
- Red Hat build of Quarkus
Timeline
- 2026-10-02 Threatist record created from CVE-2023-42503
- 2026-10-03 Alias added: GHSA-cgwf-w82q-5jrr
References
Advisory 3
More Apache Commons Compress vulnerabilities
- TI-2021-14540 Apache Commons Compress 1.0 to 1.20 denial of service vulnerability CVSS 3.1HIGH 7.5
- TI-2021-14251 Apache Commons Compress 1.1 to 1.20 denial of service vulnerability CVSS 3.1HIGH 7.5
- TI-2019-09249 Infinite loop in Apache Commons Compress CVSS 3.1HIGH 7.5
- TI-2021-14250 Apache Commons Compress 1.6 to 1.20 denial of service vulnerability CVSS 3.1HIGH 7.5
- TI-2021-14249 Apache Commons Compress 1.6 to 1.20 denial of service vulnerability CVSS 3.1HIGH 7.5
- TI-2012-01871 Algorithmic complexity vulnerability in the sorting algorithms in bzip2 compressing… CVSS 2.0MEDIUM 5.0
Sources
- CVE-2023-42503 · CVE Program
- CVE-2023-42503 · NVD
- FIRST EPSS
- GHSA-cgwf-w82q-5jrr · GitHub Advisory Database · CC BY 4.0
- CVE-2023-42503 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences