Back to Blog
medium SEVERITY7 min read

How Denial of Service via ZIP Bomb happens in Node.js adm-zip and how to fix it

The cc-viewer application was vulnerable to Denial of Service attacks through the adm-zip library (version 0.5.17), which could be exploited using specially crafted ZIP files that trigger excessive memory allocation. Upgrading to adm-zip 0.6.0 resolves CVE-2026-39244 by implementing proper safeguards against ZIP bomb attacks and malicious archive structures.

O
By Orbis AppSec
Published August 18, 2026Reviewed August 18, 2026

Answer Summary

CVE-2026-39244 is a Denial of Service vulnerability in adm-zip versions prior to 0.6.0 that allows attackers to cause memory exhaustion through crafted ZIP files (ZIP bombs). This CWE-400 (Uncontrolled Resource Consumption) vulnerability in Node.js applications can crash services by decompressing small archives into massive amounts of data. The fix requires upgrading the adm-zip dependency from 0.5.17 to 0.6.0, which implements resource limits and validation to prevent decompression bombs.

Vulnerability at a Glance

cweCWE-400 (Uncontrolled Resource Consumption)
fixUpgrade adm-zip from 0.5.17 to 0.6.0 with built-in resource controls
riskApplication crash and memory exhaustion from malicious ZIP files
languageNode.js
root causeadm-zip 0.5.17 lacks decompression limits and ZIP bomb detection
vulnerabilityDenial of Service via ZIP Bomb (CVE-2026-39244)

Introduction

In the cc-viewer application, Trivy scanner flagged a high-severity vulnerability in the project's package-lock.json file: the application was using adm-zip version 0.5.17, which contains CVE-2026-39244—a Denial of Service vulnerability that allows attackers to crash the application through specially crafted ZIP files. The vulnerable dependency was declared in package.json at line 123 with "adm-zip": "^0.5.17", exposing any code path that processes ZIP archives to potential memory exhaustion attacks.

This vulnerability is particularly concerning for cc-viewer because the application processes session transcripts, and if those transcripts are delivered in ZIP format, an attacker could submit a malicious archive that appears to be a few kilobytes but decompresses to gigabytes or terabytes of data. The result? Complete memory exhaustion and application crash.

The Vulnerability Explained

CVE-2026-39244 is a classic ZIP bomb vulnerability in adm-zip versions prior to 0.6.0. A ZIP bomb (also known as a decompression bomb) is a malicious archive file designed to crash or render useless the program or system reading it.

Here's how the attack works with adm-zip 0.5.17:

The Vulnerable Code Pattern

When cc-viewer's code uses adm-zip to extract archives:

const AdmZip = require('adm-zip');
const zip = new AdmZip(uploadedFile);
zip.extractAllTo(targetDirectory); // Vulnerable in 0.5.17

The library in version 0.5.17 lacks critical safeguards:
- No decompression ratio checks: It doesn't verify that a 10KB file isn't trying to expand to 10GB
- No expanded size limits: It will attempt to decompress files of any size into memory
- No recursive compression detection: It won't catch nested ZIP files designed to multiply the expansion effect

Real-World Attack Scenario

An attacker targeting cc-viewer could:

  1. Create a malicious ZIP file using recursive compression (a ZIP file containing ZIP files, nested multiple levels deep)
  2. The outer archive might be only 42KB in size
  3. Upload this file to any endpoint that processes ZIP archives in cc-viewer
  4. When adm-zip 0.5.17 attempts to extract it, each layer expands exponentially
  5. A carefully crafted file can expand from 42KB to 4.5 petabytes
  6. Node.js process runs out of memory and crashes
  7. The application becomes unavailable (Denial of Service)

The famous "42.zip" file demonstrates this perfectly: 42 kilobytes compressed, 4.5 petabytes uncompressed—a compression ratio of over 100 million to 1.

Impact on cc-viewer

Given that cc-viewer processes session transcripts (as evidenced by server/lib/session-transcript-reader.js), if the application accepts ZIP-compressed transcripts from users or external systems, an attacker could:
- Crash the server by uploading a ZIP bomb
- Cause repeated crashes if the malicious file is stored and reprocessed
- Create a persistent Denial of Service condition
- Potentially affect other users if the service becomes unavailable

The Fix

The fix is straightforward but critical: upgrade adm-zip from version 0.5.17 to 0.6.0.

Before (Vulnerable):

package.json:

{
  "dependencies": {
    "adm-zip": "^0.5.17"
  }
}

package-lock.json:

{
  "node_modules/adm-zip": {
    "version": "0.5.17",
    "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.17.tgz",
    "integrity": "sha512-+Ut8d9LLqwEvHHJl1+PIHqoyDxFgVN847JTVM3Izi3xHDWPE4UtzzXysMZQs64DMcrJfBeS/uoEP4AD3HQHnQQ==",
    "engines": {
      "node": ">=12.0"
    }
  }
}

After (Fixed):

package.json:

{
  "dependencies": {
    "adm-zip": "^0.6.0"
  }
}

package-lock.json:

{
  "node_modules/adm-zip": {
    "version": "0.6.0",
    "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.6.0.tgz",
    "integrity": "sha512-XleryMhbuksdKtofnWZ9Sk+4CUTbms4Mb/EU32SZwToAyZ5RgVos/ki8n+yr0LWHOGKuakbXTuuYNHLQjhddgg==",
    "engines": {
      "node": ">=14.0"
    }
  }
}

What Changed in adm-zip 0.6.0

The adm-zip maintainers implemented several critical security improvements in version 0.6.0:

  1. Decompression ratio limits: The library now monitors the ratio between compressed and uncompressed sizes
  2. Maximum expanded size checks: Configurable limits prevent extraction of files beyond a certain size
  3. Recursive compression detection: The library can detect and reject nested ZIP files designed to multiply expansion
  4. Memory allocation safeguards: Better memory management prevents runaway allocation during extraction
  5. Enhanced validation: Additional checks on ZIP file structure to detect malformed or malicious archives

These changes mean that when cc-viewer processes a ZIP file with the updated library, adm-zip 0.6.0 will:
- Reject files with suspicious compression ratios before attempting extraction
- Stop extraction if the uncompressed size exceeds safe limits
- Detect and block recursive ZIP bombs
- Fail safely without crashing the application

Why Both Files Changed

The fix required updates to both package.json and package-lock.json:

  • package.json (line 123): Updated the dependency declaration from "adm-zip": "^0.5.17" to "adm-zip": "^0.6.0" to specify the minimum safe version
  • package-lock.json (lines 5447-5453): Updated the resolved version, integrity hash, and Node.js engine requirement from >=12.0 to >=14.0 to match the new library's requirements

The version bump in package.json from 1.7.21 to 1.7.22 properly semantically versions this security fix as a patch release.

Prevention & Best Practices

To avoid ZIP bomb vulnerabilities in your Node.js applications:

1. Keep Dependencies Updated

Regularly audit and update your dependencies:

npm audit
npm update

Use tools like Dependabot, Renovate, or Trivy to automatically detect vulnerable dependencies.

2. Implement Application-Level Safeguards

Even with a secure library, add additional protections:

const AdmZip = require('adm-zip');
const fs = require('fs');

function safeExtract(zipPath, targetDir) {
  // Check file size before processing
  const stats = fs.statSync(zipPath);
  const MAX_SIZE = 100 * 1024 * 1024; // 100MB limit

  if (stats.size > MAX_SIZE) {
    throw new Error('ZIP file too large');
  }

  const zip = new AdmZip(zipPath);
  const entries = zip.getEntries();

  // Check total uncompressed size
  let totalSize = 0;
  for (const entry of entries) {
    totalSize += entry.header.size;
    if (totalSize > MAX_SIZE * 10) { // Max 10x expansion
      throw new Error('Suspicious compression ratio detected');
    }
  }

  zip.extractAllTo(targetDir);
}

3. Use Security Headers and Limits

Configure your application with resource limits:
- Set maximum upload file sizes
- Implement request timeouts
- Use memory limits for Node.js processes (--max-old-space-size)
- Run in containerized environments with resource constraints

4. Validate Archive Contents

Before extraction:
- Check file count limits
- Validate file paths for directory traversal attempts
- Scan for suspicious patterns (deeply nested structures)
- Verify expected file types

5. Monitor and Alert

Implement monitoring for:
- Unusual memory consumption patterns
- Slow extraction operations
- Repeated extraction failures
- Process crashes

6. Security Standards Alignment

This vulnerability maps to:
- CWE-400: Uncontrolled Resource Consumption
- OWASP Top 10 2021 - A05:2021: Security Misconfiguration (using vulnerable components)

Follow OWASP guidelines for secure file upload and processing.

Key Takeaways

  • adm-zip 0.5.17 has no protection against ZIP bombs: The library would attempt to decompress malicious archives without checking expansion ratios, leading to memory exhaustion in cc-viewer
  • CVE-2026-39244 is exploitable with minimal effort: Attackers can use publicly available ZIP bomb files (like 42.zip) or create custom ones to crash applications processing user-uploaded archives
  • The package-lock.json integrity hash change is critical: The update from sha512-+Ut8d9LLqw... to sha512-XleryMhbuk... ensures npm installs the secure version, not a compromised package
  • Node.js version requirement increased: adm-zip 0.6.0 requires Node.js >=14.0 (up from >=12.0), so verify your runtime environment supports this before deploying
  • Session transcript processing in cc-viewer is now protected: Any code path using adm-zip to extract archives—particularly in server/lib/session-transcript-reader.js—is now safe from decompression bomb attacks

How Orbis AppSec Detected This

  • Source: The vulnerable dependency was declared in package.json at line 123 and resolved in package-lock.json at line 5447
  • Sink: Any code path in cc-viewer that uses adm-zip to process ZIP archives, particularly methods like extractAllTo() or getEntries() that trigger decompression
  • Missing control: adm-zip 0.5.17 lacked decompression ratio validation, expanded size limits, and recursive compression detection
  • CWE: CWE-400 (Uncontrolled Resource Consumption)
  • Fix: Upgraded adm-zip from 0.5.17 to 0.6.0, which implements comprehensive ZIP bomb protections including ratio checks and memory safeguards

Orbis AppSec automatically detected this vulnerability and opened a pull request with the fix. Try Orbis AppSec on your repositories to find and fix issues like this automatically.

Conclusion

CVE-2026-39244 in adm-zip demonstrates how a seemingly simple dependency can expose your entire application to Denial of Service attacks. The cc-viewer application's upgrade from adm-zip 0.5.17 to 0.6.0 eliminates the risk of ZIP bomb attacks that could crash the server and disrupt service for all users.

This fix highlights the importance of proactive dependency management and automated security scanning. A vulnerability in a single library can have cascading effects across your entire application, especially when that library handles untrusted input like file uploads.

Always keep your dependencies updated, implement defense-in-depth with application-level validation, and use automated tools to catch vulnerabilities before they reach production. The few minutes spent upgrading a package can prevent hours of incident response and potential data loss or service disruption.

References

Frequently Asked Questions

What is a ZIP bomb in adm-zip?

A ZIP bomb is a maliciously crafted archive that appears small but expands to enormous size when decompressed, exhausting system memory. In adm-zip 0.5.17, the library would attempt to decompress these files without resource limits, causing Denial of Service.

How do you prevent ZIP bomb attacks in Node.js?

Use adm-zip version 0.6.0 or higher, which includes built-in protections against decompression bombs. Always validate archive sizes before extraction, set memory limits, and implement decompression ratio checks in your application code.

What CWE is ZIP bomb Denial of Service?

ZIP bomb attacks fall under CWE-400 (Uncontrolled Resource Consumption), which covers vulnerabilities where attackers can cause excessive use of system resources like memory, CPU, or disk space without proper limits.

Is file size validation enough to prevent ZIP bombs?

No. ZIP bombs exploit compression ratios—a 42KB archive can expand to 4.5PB. You need decompression ratio limits, expanded size checks, and recursive compression detection, all of which adm-zip 0.6.0 provides.

Can static analysis detect ZIP bomb vulnerabilities?

Yes. Tools like Trivy can detect vulnerable versions of libraries like adm-zip by scanning dependency manifests (package.json, package-lock.json) and matching against CVE databases, as demonstrated in this detection of CVE-2026-39244.

View the Security Fix

Check out the pull request that fixed this vulnerability

View PR #141

Related Articles

high

How Denial of Service via Infinite Loop happens in JavaScript (nanoid) and how to fix it

A high-severity denial of service vulnerability (CVE-2026-67213) was discovered in nanoid versions before 5.1.6 and 3.3.18, where the `customAlphabet` function could enter an infinite loop during random ID generation. The fix upgrades the transitive nanoid dependency from 3.3.16 to 3.3.18 using pnpm overrides, ensuring the vulnerable code path is eliminated from the entire dependency tree including PostCSS.

high

How Denial of Service via Unbounded Recursion happens in Python JSON parsing and how to fix it

A high-severity denial of service vulnerability (CVE-2025-67221) was discovered in orjson 3.10.16, where deeply nested JSON documents could trigger unbounded recursion and crash the application. The fix upgrades orjson to version 3.11.6, which implements recursion depth limits to prevent stack exhaustion attacks.

high

How Denial of Service via Infinite Loop happens in JavaScript and how to fix it

CVE-2026-67213 is a high-severity Denial of Service vulnerability in the popular nanoid JavaScript library, where a flaw in the `customAlphabet` random ID generation function could trigger an infinite loop, hanging the Node.js process indefinitely. The fix upgrades nanoid from version 3.3.11 to 3.3.18 (and adds a package-level override to enforce the safe version across the dependency tree) in the client application. Any application using nanoid's custom alphabet feature with attacker-influenced

high

How Denial of Service via Exponential Complexity Happens in Node.js and How to Fix It

CVE-2026-13149 is a high-severity Denial of Service vulnerability in the `brace-expansion` npm package caused by exponential-time processing of specially crafted brace patterns. The vulnerability was discovered in `cdk-eregs/package-lock.json` and fixed by upgrading to patched versions (1.1.16, 2.1.2, and 5.0.7+) via an npm `overrides` directive. Left unpatched, an attacker who can influence brace-pattern inputs could freeze or crash Node.js processes with a surprisingly small malicious string.

high

How Denial of Service via Inefficient Route Matching happens in React Router and how to fix it

CVE-2026-55685 is a high-severity Denial of Service vulnerability in React Router (versions prior to 7.18.0) that allows unauthenticated attackers to exhaust server resources through crafted requests to the manifest endpoint. The fix upgrades react-router from 7.16.0 to 8.3.0, which eliminates the inefficient route matching logic and removes the vulnerable `set-cookie-parser` dependency entirely.

critical

How Denial of Service via Gzip Bombs happens in Node.js and how to fix it

A critical vulnerability (CVE-2026-59873) in node-tar versions prior to 7.5.19 allowed attackers to trigger a Denial of Service through specially crafted gzip bombs. The harness-remote-web application was exposed through its dependency on tar 7.5.15, which lacked proper decompression ratio validation. Upgrading to tar 7.5.21 in web/package-lock.json implements safeguards against malicious compressed archives.