GHSA-rcw4-f5rp-g42v: adm-zip Decompression-bomb Protection (fix For CVE-2026-39244) Vulnerability

HIGH
CVSS 7.5
CWE-409
Published
Advisory Summary

GHSA-rcw4-f5rp-g42v is a HIGH (CVSS 7.5) decompression-bomb protection (fix for cve-2026-39244) vulnerability (CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)) affecting adm-zip libraries in the npm ecosystem. The issue involves decompression-bomb protection (fix for cve-2026-39244) can be bypassed by declaring uncompressed size as 0. Remediation is available by upgrading affected packages to version 0.6.1.

GHSA-rcw4-f5rp-g42v at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-rcw4-f5rp-g42v
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)
Affected Product adm-zip
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix GHSA-rcw4-f5rp-g42v

To remediate this vulnerability, upgrade all affected adm-zip dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

adm-zip fixed: 0.6.1
npm install adm-zip@0.6.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls adm-zip

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-rcw4-f5rp-g42v, inspect your project dependencies using npm:

npm ls adm-zip

Analyze the terminal output to locate any version of adm-zip in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.6.1), your application is affected.

Note: The npm ls adm-zip command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification), where the product does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output. In adm-zip, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

**Affected package:** adm-zip (npm) **Affected version:** 0.6.0 ## Summary The fix shipped for CVE-2026-39244 (`methods/inflater.js`) caps zlib's decompression output via `maxOutputLength: expectedLength`, where `expectedLength` is read directly from the ZIP entry's attacker-controlled "uncompressed size" header field (`CENLEN`/`LOCLEN`). This cap is only applied when `expectedLength > 0`: ```js const option = version >= 15 && expectedLength > 0 ? { maxOutputLength: expectedLength } : {}; return zlib.inflateRawSync(inbuf, option); ``` If an attacker sets the declared uncompressed-size field to exactly **0**, this condition is false, `option` becomes `{}`, and no output cap is passed to zlib at all. Node then falls back to zlib's own internal default limit (several GB), so a small, highly-compressible payload can still be decompressed to a very large size in memory -- the same class of resource-exhaustion issue the original CVE addressed, just triggered differently. ## Steps to Reproduce 1. Build a ZIP archive containing one DEFLATE-compressed entry whose real content is highly redundant (e.g. several MB of a repeated byte, achieving close to the ~1032:1 theoretical raw-DEFLATE compression ratio). 2. Patch the entry's declared uncompressed-size fields (both the local file header copy and the central directory copy, 4-byte little-endian values) to `0`. The compressed bytes and CRC32 are left untouched -- CRC validation still passes because CRC is computed over the real decompressed output, not the declared size. 3. Load the archive with `new AdmZip(buffer)` and call `.getEntries()[0].getData()` (or `readFile`/`readAsText`/`extractAllTo`/etc. -- all share the same code path). 4. Observe: decompression succeeds and returns the full-size buffer with no size restriction applied, whereas the same real data with an honest (but undersized) declared value correctly throws `Cannot create a Buffer larger than N bytes`. ## Proof of Concept Attached script demonstrates a controlled A/B comparison using the identical real payload in both cases -- only the declared-size header field differs: - **Control** (declared size = 1024 bytes, deliberately smaller than the true 4MB output): correctly throws, proving the cap mechanism works when `expectedLength > 0`. - **Bypass** (declared size = 0, identical real payload): succeeds and returns the full 4,194,304-byte buffer with zero restriction. Verified reproducible across 3 independent runs. ## Impact Any application that calls adm-zip's read/extract methods on an untrusted ZIP file (upload handlers, CI artifact extraction, email attachment scanning, etc.) can be made to allocate an amount of memory bounded only by zlib's own internal default rather than any limit the application or adm-zip intends -- a small (tens-of-MB) upload can trigger multi-GB memory consumption, risking process crash/OOM. ## Suggested Fix Apply `maxOutputLength` unconditionally (e.g. defaulting to a sane absolute ceiling, or always passing the declared size regardless of whether it's 0), and/or add an independent compression-ratio check that doesn't rely solely on the attacker-supplied size field.

GHSA-rcw4-f5rp-g42v Affected adm-zip Versions

1 component(s)
Fixed Versions:
0.6.1
Product / Package Ecosystem Affected Versions Fixed Version
adm-zip
npm
< 0.6.1
0.6.1

References

Frequently Asked Questions

What is GHSA-rcw4-f5rp-g42v?
GHSA-rcw4-f5rp-g42v is a security vulnerability in adm-zip involving Decompression-bomb protection (fix for CVE-2026-39244) can be bypassed by declaring uncompressed size as 0 under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification).
Which adm-zip versions are affected?
Affected versions include releases prior to 0.6.1 across affected packages: adm-zip.
What version fixes GHSA-rcw4-f5rp-g42v?
Upgrading to 0.6.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is adm-zip affected?
Yes, adm-zip is affected in releases prior to 0.6.1. Upgrade your dependency to 0.6.1 or later.
What is the CVSS score of GHSA-rcw4-f5rp-g42v?
GHSA-rcw4-f5rp-g42v has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with GHSA-rcw4-f5rp-g42v?
GHSA-rcw4-f5rp-g42v is classified under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification) (The product does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output.).
How can I check npm dependencies for GHSA-rcw4-f5rp-g42v?
Run the dependency tree command: 'npm ls adm-zip'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-rcw4-f5rp-g42v",
  "modified" : "2026-09-29T18:25:20Z",
  "published" : "2026-09-29T18:25:20Z",
  "aliases" : [ ],
  "summary" : "adm-zip: Decompression-bomb protection (fix for CVE-2026-39244) can be bypassed by declaring uncompressed size as 0",
  "details" : "**Affected package:** adm-zip (npm)\n**Affected version:** 0.6.0\n\n## Summary\n\nThe fix shipped for CVE-2026-39244 (`methods/inflater.js`) caps zlib's decompression output via `maxOutputLength: expectedLength`, where `expectedLength` is read directly from the ZIP entry's attacker-controlled \"uncompressed size\" header field (`CENLEN`/`LOCLEN`). This cap is only applied when `expectedLength > 0`:\n\n```js\nconst option = version >= 15 && expectedLength > 0 ? { maxOutputLength: expectedLength } : {};\nreturn zlib.inflateRawSync(inbuf, option);\n```\n\nIf an attacker sets the declared uncompressed-size field to exactly **0**, this condition is false, `option` becomes `{}`, and no output cap is passed to zlib at all. Node then falls back to zlib's own internal default limit (several GB), so a small, highly-compressible payload can still be decompressed to a very large size in memory -- the same class of resource-exhaustion issue the original CVE addressed, just triggered differently.\n\n## Steps to Reproduce\n\n1. Build a ZIP archive containing one DEFLATE-compressed entry whose real content is highly redundant (e.g. several MB of a repeated byte, achieving close to the ~1032:1 theoretical raw-DEFLATE compression ratio).\n2. Patch the entry's declared uncompressed-size fields (both the local file header copy and the central directory copy, 4-byte little-endian values) to `0`. The compressed bytes and CRC32 are left untouched -- CRC validation still passes because CRC is computed over the real decompressed output, not the declared size.\n3. Load the archive with `new AdmZip(buffer)` and call `.getEntries()[0].getData()` (or `readFile`/`readAsText`/`extractAllTo`/etc. -- all share the same code path).\n4. Observe: decompression succeeds and returns the full-size buffer with no size restriction applied, whereas the same real data with an honest (but undersized) declared value correctly throws `Cannot create a Buffer larger than N bytes`.\n\n## Proof of Concept\n\nAttached script demonstrates a controlled A/B comparison using the identical real payload in both cases -- only the declared-size header field differs:\n\n- **Control** (declared size = 1024 bytes, deliberately smaller than the true 4MB output): correctly throws, proving the cap mechanism works when `expectedLength > 0`.\n- **Bypass** (declared size = 0, identical real payload): succeeds and returns the full 4,194,304-byte buffer with zero restriction.\n\nVerified reproducible across 3 independent runs.\n\n## Impact\n\nAny application that calls adm-zip's read/extract methods on an untrusted ZIP file (upload handlers, CI artifact extraction, email attachment scanning, etc.) can be made to allocate an amount of memory bounded only by zlib's own internal default rather than any limit the application or adm-zip intends -- a small (tens-of-MB) upload can trigger multi-GB memory consumption, risking process crash/OOM.\n\n## Suggested Fix\n\nApply `maxOutputLength` unconditionally (e.g. defaulting to a sane absolute ceiling, or always passing the declared size regardless of whether it's 0), and/or add an independent compression-ratio check that doesn't rely solely on the attacker-supplied size field.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "adm-zip"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.6.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.6.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cthackers/adm-zip/security/advisories/GHSA-rcw4-f5rp-g42v"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cthackers/adm-zip/commit/491600683dacb6cb9fe0718a0eeb9cb5eb49afa6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cthackers/adm-zip"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cthackers/adm-zip/releases/tag/v0.6.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-409" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-29T18:25:20Z",
    "nvd_published_at" : null
  }
}