HIGH 7.5

CVE-2026-39244: adm-zip Denial of Service via Malicious ZIP Memory Exhaustion

The adm-zip library before version 0.5.18 contains a memory exhaustion vulnerability triggered by specially crafted ZIP files. When a malicious ZIP file declares an extremely large uncompressed size in its header—while the actual file is tiny—the library allocates huge amounts of memory without checking whether that size is reasonable. A 120-byte malicious ZIP file can trick the library into attempting to allocate 4GB of memory, crashing the application. This happens automatically during any attempt to read or extract the ZIP file, and occurs before the library can validate the file's integrity.

Source data · NVD / CISA · public domain

CVSS
3.1 · 7.5 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weaknesses (CWE)
CWE-400
Affected products
0 configuration(s)
Published / Modified
2026-07-10 / 2026-07-10

NVD description (verbatim)

adm-zip before 0.5.18 is vulnerable to denial of service via a crafted ZIP file with a manipulated uncompressed size header field. In zipEntry.js line 103, Buffer.alloc(_centralHeader.size) allocates memory based on the declared uncompressed size from the ZIP central directory header without validating it against the actual compressed data size or imposing any upper bound. The size value is read directly from the binary header at entryHeader.js line 266 with no bounds check. An attacker can craft a ~120-byte ZIP file that declares ~4GB uncompressed size, causing a memory allocation amplification ratio of over 33 million to 1. The allocation occurs before CRC validation, so the malicious payload cannot be rejected early. All extraction and read methods are affected: readFile(), readAsText(), extractEntryTo(), extractAllTo(), extractAllToAsync(), test(), and entry.getData(). Any application accepting untrusted ZIP files via adm-zip is vulnerable to immediate process crash.

4 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability exists in adm-zip's zipEntry.js (line 103) and entryHeader.js (line 266) where the uncompressed size field from the ZIP central directory header is read and passed directly to Buffer.alloc() without bounds validation. The CWE-400 (Uncontrolled Resource Consumption) flaw allows an attacker to construct a ZIP archive with a drastically inflated size declaration. Since memory allocation happens before CRC validation, malicious files cannot be rejected through integrity checks. The attack affects all entry points: readFile(), readAsText(), extractEntryTo(), extractAllTo(), extractAllToAsync(), test(), and entry.getData(). The amplification ratio—over 33 million to 1 between declared and actual size—makes this a highly efficient denial-of-service vector.

Business impact

Any application or service using adm-zip to process untrusted ZIP files becomes vulnerable to immediate denial of service. File processing services, document handlers, backup utilities, and deployment tools that accept user-uploaded or network-sourced archives can crash upon encountering a malicious file. This impacts availability; attackers need no authentication or interaction beyond file submission. In high-volume scenarios (API endpoints, batch processors), a single request with a crafted ZIP can terminate the worker process, potentially affecting multiple transactions or users.

Affected systems

adm-zip versions prior to 0.5.18 are vulnerable. Any Node.js application directly using adm-zip—or indirectly through a dependency—for ZIP file operations is at risk. This includes web servers, CLI tools, build systems, archive managers, and file synchronization utilities. The vulnerability requires no special configuration; simply importing and using any read or extraction method on untrusted ZIP data is sufficient to trigger the issue.

Exploitability

Exploitation requires only network or file-system access to supply a crafted ZIP file to a vulnerable application. No authentication, user interaction, or complex techniques are necessary. The attack surface is broad: any endpoint accepting file uploads, API accepting binary data, or command-line tool processing archives is exploitable. The low complexity and lack of prerequisites (CVSS AC:L, PR:N, UI:N) make this straightforward to weaponize. However, practical impact depends on whether the application re-spawns crashed workers or has redundancy.

Remediation

Upgrade adm-zip to version 0.5.18 or later. This update adds bounds checking to the uncompressed size field, preventing memory allocation amplification attacks. Verify the upgrade in your package.json or lock file (package-lock.json / yarn.lock) after running npm update or yarn upgrade. For applications unable to update immediately, implement application-level safeguards: reject ZIP files exceeding a reasonable size threshold before passing them to adm-zip, or run ZIP processing in isolated, resource-constrained child processes that can be safely terminated.

Patch guidance

Update your adm-zip dependency to version 0.5.18 or higher. In npm environments: run 'npm install adm-zip@latest' or edit package.json to require '^0.5.18' and reinstall. In yarn: 'yarn upgrade adm-zip'. After updating, rebuild and redeploy your application. If you maintain applications that bundle adm-zip, ensure all downstream packages also receive the updated version. Verify the fix by checking that adm-zip in node_modules reflects the corrected version. Consider adding a pre-deployment test that attempts to process a known malicious ZIP (available in the CVE test suite) to confirm the fix blocks the attack.

Detection guidance

Monitor for unusual memory consumption spikes or out-of-memory exceptions in processes running adm-zip. Log file submission sizes and compare against decompressed sizes reported by the library; anomalous ratios suggest attempted exploitation. Watch for repeated process crashes following file uploads or archive processing requests. In containerized environments, track memory limits being hit unexpectedly. Implement dependency scanning in your CI/CD pipeline (npm audit, Snyk, Dependabot) to flag adm-zip versions below 0.5.18 before code reaches production. If you have sample malicious ZIPs, you may test them against current versions to verify vulnerability or patch status.

Why prioritize this

This vulnerability warrants immediate attention despite a single-application scope. The HIGH severity (CVSS 7.5) reflects straightforward exploitability, complete availability impact, and network accessibility. The amplification ratio and broad API surface (seven different entry points) mean multiple code paths can trigger the crash. Organizations running file-processing services, especially those exposed to the internet or untrusted users, should prioritize patching. The fix is simple (version bump), and no workaround is as robust as upgrading.

Risk score, explained

CVSS 3.1 score of 7.5 (HIGH) reflects: Attack Vector Network (AV:N)—the file can originate remotely; Attack Complexity Low (AC:L)—no special conditions required; Privileges Required None (PR:N) and User Interaction None (UI:N)—no authentication or user action needed; Confidentiality None (C:N) and Integrity None (I:N)—no data breach or corruption; Availability High (A:H)—reliable, complete process termination. The score does not account for widespread mitigation (containerization, worker processes) or limited scope, but reflects the inherent severity of the flaw itself.

Frequently asked questions

Can this vulnerability be exploited without uploading a file to the application?

No. Exploitation requires the vulnerable application to process a crafted ZIP file through adm-zip. If your application does not accept or process ZIP files, it is not directly affected. However, if a dependency of your application uses adm-zip internally, risk may still exist.

Does updating adm-zip require code changes in my application?

No. Version 0.5.18 is backward compatible. Simply upgrading the package and redeploying is sufficient. No API calls or logic changes are needed. The fix operates transparently at the library level.

Why does the vulnerability manifest as a crash rather than a controlled error?

Buffer.alloc() in Node.js will either succeed (allocating 4GB) and exhaust system memory, causing the process to crash, or fail with an out-of-memory exception. The vulnerability exists precisely because no upper-bound check exists to reject obviously invalid sizes before allocation is attempted.

Are there workarounds if I cannot upgrade adm-zip immediately?

Yes. Implement input validation before passing files to adm-zip: check file size and reject anything unusually large, or run ZIP processing in a separate child process with memory limits. However, these are defensive layers; upgrading remains the proper fix.

This analysis is based on CVE-2026-39244 as published and does not constitute professional security advice. Organizations should conduct their own risk assessment specific to their environment, dependencies, and exposure. Test patches in non-production environments before deployment. The vulnerability details and remediation guidance are current as of the publication date; refer to the official adm-zip repository and security advisories for the latest information. No exploit code or weaponized proof-of-concept is provided in this document. Source: NVD (public-domain), retrieved 2026-08-17. Analysis generated by SEC.co (claude-haiku-4-5).