GHSA-c6fg-446q-cg94: adm-zip Remote Code Execution Vulnerability

MODERATE
CVSS 5.3
CWE-400 CWE-770
Published
Advisory Summary

GHSA-c6fg-446q-cg94 is a MODERATE (CVSS 5.3) remote code execution vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting adm-zip libraries in the npm ecosystem. The issue involves getdataasync() bypasses the maxoutputlength size guard enforced by the synchronous getdata() path. Remediation is available by upgrading affected packages to version 0.6.1.

GHSA-c6fg-446q-cg94 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-c6fg-446q-cg94
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product adm-zip
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.3

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:L).

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 Low (A:L)

How to Fix GHSA-c6fg-446q-cg94

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-c6fg-446q-cg94, 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. 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

### Summary adm-zip enforces a `maxOutputLength` guard against decompression bombs on its synchronous `getData()` path, but the equivalent asynchronous `getDataAsync()` path does not enforce it — it accumulates and returns the entire decompressed output regardless of the entry's declared size. An application that checks an entry's declared size before deciding to process it, then reads the entry via `getDataAsync()` (a completely ordinary, often-recommended choice for I/O in Node.js), gets none of the protection it believes it has. ### Details - `methods/inflater.js:3-10` passes `{maxOutputLength: expectedLength}` to `inflateRawSync`, which Node enforces. - `methods/inflater.js:12-31` passes the same option to `createInflateRaw` but never enforces it on the streaming path — it just accumulates every chunk and allocates a final Buffer of whatever size resulted. ### PoC ```js const AdmZip = require('adm-zip'); const zip = new AdmZip(); zip.addFile('p', Buffer.alloc(64 * 1024 * 1024, 0x41)); // 64 MiB const raw = Buffer.from(zip.toBuffer()); // patch the local + central declared uncompressed size to 1 byte raw.writeUInt32LE(1, localHeaderSizeOffset); raw.writeUInt32LE(1, centralHeaderSizeOffset); const entry = new AdmZip(raw).getEntry('p'); entry.getData(); // throws: ERR_BUFFER_TOO_LARGE: Cannot create a Buffer larger than 1 bytes entry.getDataAsync((data, error) => { ... }); // returns the full 67,108,864-byte buffer, error is undefined ``` ### Impact An application that validates a declared size before reading an entry, then uses the async API, gets no protection against a high-ratio DEFLATE payload. Repeated or larger requests could contribute to memory exhaustion.

GHSA-c6fg-446q-cg94 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-c6fg-446q-cg94?
GHSA-c6fg-446q-cg94 is a security vulnerability in adm-zip involving getDataAsync() bypasses the maxOutputLength size guard enforced by the synchronous getData() path under CWE-400: Uncontrolled Resource Consumption.
Which adm-zip versions are affected?
Affected versions include releases prior to 0.6.1 across affected packages: adm-zip.
What version fixes GHSA-c6fg-446q-cg94?
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-c6fg-446q-cg94?
GHSA-c6fg-446q-cg94 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with GHSA-c6fg-446q-cg94?
GHSA-c6fg-446q-cg94 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check npm dependencies for GHSA-c6fg-446q-cg94?
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-c6fg-446q-cg94",
  "modified" : "2026-09-29T23:10:32Z",
  "published" : "2026-09-29T23:10:32Z",
  "aliases" : [ ],
  "summary" : "adm-zip: getDataAsync() bypasses the maxOutputLength size guard enforced by the synchronous getData() path",
  "details" : "### Summary\nadm-zip enforces a `maxOutputLength` guard against decompression bombs on its synchronous `getData()` path, but the equivalent asynchronous `getDataAsync()` path does not enforce it — it accumulates and returns the entire decompressed output regardless of the entry's declared size. An application that checks an entry's declared size before deciding to process it, then reads the entry via `getDataAsync()` (a completely ordinary, often-recommended choice for I/O in Node.js), gets none of the protection it believes it has.\n\n\n### Details\n\n- `methods/inflater.js:3-10` passes `{maxOutputLength: expectedLength}` to `inflateRawSync`, which Node enforces.\n- `methods/inflater.js:12-31` passes the same option to `createInflateRaw` but never enforces it on the streaming path — it just accumulates every chunk and allocates a final Buffer of whatever size resulted.\n\n\n### PoC\n\n```js\nconst AdmZip = require('adm-zip');\nconst zip = new AdmZip();\nzip.addFile('p', Buffer.alloc(64 * 1024 * 1024, 0x41)); // 64 MiB\nconst raw = Buffer.from(zip.toBuffer());\n// patch the local + central declared uncompressed size to 1 byte\nraw.writeUInt32LE(1, localHeaderSizeOffset);\nraw.writeUInt32LE(1, centralHeaderSizeOffset);\nconst entry = new AdmZip(raw).getEntry('p');\n\nentry.getData();\n// throws: ERR_BUFFER_TOO_LARGE: Cannot create a Buffer larger than 1 bytes\n\nentry.getDataAsync((data, error) => { ... });\n// returns the full 67,108,864-byte buffer, error is undefined\n```\n\n### Impact\nAn application that validates a declared size before reading an entry, then uses the async API, gets no protection against a high-ratio DEFLATE payload. Repeated or larger requests could contribute to memory exhaustion.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "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-c6fg-446q-cg94"
  }, {
    "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-400", "CWE-770" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-29T23:10:32Z",
    "nvd_published_at" : null
  }
}