Commons CompressApplication · Apache

CVE-2023-42503

MEDIUM · 5.5 CVSS v3.1 Published 2023-09-14
Fix available
A fix is available. Upgrade to 1.24.0 or later.
See remediation →
58/100
Remediation priority · Elevated
No privileges

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

Apache Commons Compress versions 1.22 through 1.23 have an improper input validation vulnerability in TAR file parsing. When parsing PAX extended headers for file modification times (atime, ctime, mtime, LIBARCHIVE.creationtime), the code uses BigDecimal without validating input length. Attackers can craft TAR files with extremely long numeric strings (300,000+ digits) or exponent notation (e.g., '9e9999999') that trigger BigDecimal's known algorithmic complexity issue, causing CPU exhaustion and denial of service.

MitigationUpgrade Apache Commons Compress to version 1.24.0 or later, which includes input validation for PAX header timestamp values.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
Commons CompressApplication
Affected:>= 1.22, < 1.24.0

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Local
Complexity
Low
Privileges
None
User interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify Apache Commons Compress version
    Locate the commons-compress JAR file in your application classpath or dependency management system (Maven pom.xml, Gradle build.gradle, or the actual JAR in lib/ directory). Check the filename or manifest for the version number.
    Affected if Version is 1.22, 1.23, or any version >= 1.22 and < 1.24.0
  2. Verify TAR parsing is in use
    Search your application code for imports of org.apache.commons.compress.archivers.tar or usage of TarArchiveInputStream, TarFile, or related TAR handling classes.
    Affected if Your application code directly or indirectly uses Apache Commons Compress to parse TAR files
  3. Confirm PAX header processing occurs
    Review application logs or debug output during TAR file processing, or trace code paths that handle PAX extended headers (look for PAXConstants, PAXHeaderContext, or handling of atime/ctime/mtime/LIBARCHIVE.creationtime fields).
    Affected if The TAR parser processes PAX extended headers, which is the default behavior for PAX-format TAR archives

Your environment is affected if Apache Commons Compress version is 1.22, 1.23, or any version >= 1.22 and < 1.24.0 AND your application parses TAR files that may contain PAX extended headers with timestamp fields.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 1.24.0 or later
Fixed in 1.24.0
Interim mitigation

Upgrade Apache Commons Compress to version 1.24.0 or later, which includes input validation for PAX header timestamp values.

Recommended fix High confidence

1.24.0

  1. 1. Identify all dependencies on Apache Commons Compress in your project (e.g., via pom.xml, build.gradle, or dependency management system).
  2. 2. Locate the current version of Commons Compress (likely 1.22, 1.23, or any version >=1.22 and <1.24.0).
  3. 3. Update the dependency version to 1.24.0.
  4. 4. Rebuild and test the application to ensure the upgrade does not introduce regressions.
  5. 5. Redeploy the updated application.
Caveat Minimal risk - upgrading from 1.22+ to 1.24.0 is a minor version bump within the same major version; patch releases typically maintain backward compatibility.

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Commons Compress Scoped from the published advisory
  • Consultation4.0 h
  • Implementation8.0 h
  • Testing4.0 h
  • Review / QA2.0 h
18.0 hours of engineering $3,200
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $5,120.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2023-42503 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2023-42503 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data