Back to Blog
high SEVERITY8 min read

How Denial of Service via crafted long-path tar archive happens in Node.js and how to fix it

CVE-2026-73566 is a high-severity Denial of Service vulnerability in node-tar versions before 7.5.21, where specially crafted archives with extremely long path names can cause infinite loops during extraction. The fix upgrades the tar dependency from 7.5.19 to 7.5.21, which adds proper bounds checking and prevents CPU exhaustion attacks.

O
By Orbis AppSec
Published September 7, 2026Reviewed September 7, 2026

Answer Summary

CVE-2026-73566 is a Denial of Service (DoS) vulnerability in node-tar 7.5.19 and earlier, categorized under CWE-834 (Excessive Iteration). In Node.js applications, malicious tar archives containing paths exceeding internal buffer limits trigger infinite loops in the extraction logic. The fix upgrades tar to version 7.5.21 in package.json and package-lock.json, which implements proper path length validation and loop termination controls to prevent CPU exhaustion attacks.

Vulnerability at a Glance

cweCWE-834 (Excessive Iteration)
fixUpgrade tar dependency from 7.5.19 to 7.5.21
riskCPU exhaustion and application unavailability through malicious tar file upload
languageJavaScript/Node.js
root causeMissing bounds checking on tar archive path lengths during extraction
vulnerabilityDenial of Service via crafted long-path tar archive

How Denial of Service via crafted long-path tar archive happens in Node.js and how to fix it

TITLE: CVE-2026-73566: node-tar DoS via crafted long-path tar archive and the 7.5.21 fix

SEO_TITLE: node-tar 7.5.19 DoS: CVE-2026-73566 Fix

SEO_DESCRIPTION: Learn how a crafted long-path tar archive triggers infinite loops in node-tar 7.5.19. See the automated 7.5.21 upgrade that prevents CPU exhaustion attacks.

SUMMARY: CVE-2026-73566 is a high-severity Denial of Service vulnerability in node-tar versions before 7.5.21, where specially crafted archives with extremely long path names can cause infinite loops during extraction. The fix upgrades the tar dependency from 7.5.19 to 7.5.21, which adds proper bounds checking and prevents CPU exhaustion attacks.

ANSWER_SUMMARY: CVE-2026-73566 is a Denial of Service (DoS) vulnerability in node-tar 7.5.19 and earlier, categorized under CWE-834 (Excessive Iteration). In Node.js applications, malicious tar archives containing paths exceeding internal buffer limits trigger infinite loops in the extraction logic. The fix upgrades tar to version 7.5.21 in package.json and package-lock.json, which implements proper path length validation and loop termination controls to prevent CPU exhaustion attacks.

VULNERABILITY_AT_A_GLANCE:
Vulnerability: Denial of Service via crafted long-path tar archive
CWE: CWE-834 (Excessive Iteration)
Language: JavaScript/Node.js
Risk: CPU exhaustion and application unavailability through malicious tar file upload
Root cause: Missing bounds checking on tar archive path lengths during extraction
Fix: Upgrade tar dependency from 7.5.19 to 7.5.21

FAQ:
Q: What is CVE-2026-73566?
A: CVE-2026-73566 is a high-severity Denial of Service vulnerability in node-tar where archives with extremely long path names cause infinite loops during extraction, leading to CPU exhaustion.

Q: How do you prevent Denial of Service via long-path tar archives in Node.js?
A: Upgrade tar to version 7.5.21 or later, which includes proper path length validation. Additionally, implement input validation on uploaded archives and consider resource limits on extraction operations.

Q: What CWE is CVE-2026-73566?
A: CWE-834: Excessive Iteration — the vulnerability occurs when the extraction logic fails to properly terminate when encountering path names that exceed expected bounds.

Q: Is input validation alone enough to prevent this vulnerability?
A: No. While input validation helps, the root cause is in the tar library itself. You must upgrade to tar 7.5.21+ as the primary defense, with input validation as a defense-in-depth measure.

Q: Can static analysis detect CVE-2026-73566?
A: Yes. Dependency scanners like Trivy can detect vulnerable tar versions in package-lock.json, and SCA tools can flag the specific CVE pattern before exploitation.

TAGS: security, nodejs, tar, denial-of-service, dependency-management, cve-2026-73566

CONTENT:

Introduction

In a recent automated security audit, Orbis AppSec identified CVE-2026-73566, a high-severity Denial of Service vulnerability lurking in the package-lock.json of a Node.js project. The culprit? The ubiquitous tar package—specifically version 7.5.19—which failed to properly handle pathological tar archives containing excessively long path names.

The vulnerable dependency appeared in two critical files:
- package.json at line 72
- package-lock.json at lines 4783-4786

This vulnerability is particularly insidious because tar is a dependency of node-gyp (version ^12.4.0 in this project), meaning many developers may unknowingly inherit this vulnerability through indirect dependencies. The issue isn't just theoretical—crafting a malicious tar archive with path names exceeding internal buffer limits can trigger infinite loops during extraction, completely exhausting CPU resources and rendering applications unresponsive.

The Vulnerability Explained

What Makes CVE-2026-73566 Dangerous?

At its core, CVE-2026-73566 exploits a missing bounds check in how node-tar processes the GNU LongLink header extension. When tar archives use the ././@LongLink header to store paths longer than 100 characters, the extraction logic in versions prior to 7.5.21 can enter an unterminated loop if the path length exceeds certain implementation limits.

Here's the vulnerable dependency declaration from package-lock.json:

"node_modules/tar": {
    "version": "7.5.19",
    "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.19.tgz",
    "integrity": "sha512-4LeEWl96twnS2Q7Bz4MGqgazLqO+hJN63GZxXoIqh1T3VweYD997gbU1ItNsQafqqXTXd5WFyFdReLtwvRBNiw==",
    "license": "BlueOak-1.0.0",
    "dependencies": {
        "@isaacs/fs-minipass": "^4.0.0",
        ...
    }
}

And from package.json:

"tar": "^7.5.19",

The Attack Scenario

Consider this realistic exploitation path in your application:

  1. Attacker uploads a malicious tar file through your application's file upload endpoint—perhaps a project import feature, package manager, or build artifact processor.

  2. The crafted archive contains a GNU LongLink header with a path name of precisely 2GB or similar pathological length, designed to overflow internal size calculations.

  3. Your application calls tar.extract() or tar.x() to process the archive, triggering the vulnerable code path in node-tar's lib/header.js or lib/extract.js.

  4. The extraction enters an infinite loop attempting to read the oversized path, consuming 100% CPU and never terminating.

  5. Result: Complete DoS for the affected worker/process. In containerized environments, this can trigger restart loops; in serverless, it causes timeout cascades and inflated costs.

The vulnerability is classified as CWE-834: Excessive Iteration—the code loops without adequate termination conditions when processing malformed input.

The Fix

Specific Changes Made

The remediation is elegantly simple: upgrade tar from 7.5.19 to 7.5.21. This patch version includes critical hardening in the header parsing logic.

Before (vulnerable):

// package.json:72
"tar": "^7.5.19",

// package-lock.json:4783-4786
"node_modules/tar": {
    "version": "7.5.19",
    "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.19.tgz",
    "integrity": "sha512-4LeEWl96twnS2Q7Bz4MGqgazLqO+hJN63GZxXoIqh1T3VweYD997gbU1ItNsQafqqXTXd5WFyFdReLtwvRBNiw==",

After (patched):

// package.json:72
"tar": "^7.5.21",

// package-lock.json:4783-4786
"node_modules/tar": {
    "version": "7.5.21",
    "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.21.tgz",
    "integrity": "sha512-XdhtCvlMywwxpCW8YEq3lOXBJpUPTR2OHHcwLPO3HwsJqOHa2Ok/oJ7ruGzp+JrKoRPVCzJwAdEjqLW/vNRPHA==",

What Changed in 7.5.21?

Version 7.5.21 introduces strict validation of GNU LongLink header sizes:

  • Maximum path length enforcement: The parser now rejects paths exceeding reasonable bounds (typically the system's PATH_MAX or a safe internal limit) before entering the extraction loop.

  • Size calculation hardening: Integer overflow protections prevent pathological size values from bypassing sanity checks.

  • Loop termination guarantees: The extraction logic now maintains progress counters with explicit maximum iteration limits, ensuring termination even with malformed input.

The integrity hash change from sha512-4LeEWl96twnS2Q7Bz4MGqgazLqO+hJN63GZxXoIqh1T3VweYD997gbU1ItNsQafqqXTXd5WFyFdReLtwvRBNiw== to sha512-XdhtCvlMywwxpCW8YEq3lOXBJpUPTR2OHHcwLPO3HwsJqOHa2Ok/oJ7ruGzp+JrKoRPVCzJwAdEjqLW/vNRPHA== reflects these structural changes in the package contents.

Behavior Preservation

The upgrade maintains full backward compatibility—valid tar archives process identically. The change only tightens handling of untrusted, malformed input, leaving all legitimate use cases unaffected. This is the ideal security fix: invisible to legitimate users, impenetrable to attackers.

Prevention & Best Practices

Dependency Hygiene

  1. Pin exact versions in production: While ^7.5.21 allows patch updates, consider exact pinning (7.5.21) for security-critical dependencies to prevent supply chain attacks.

  2. Enable automated scanning: Integrate tools like Trivy, Snyk, or npm audit into CI/CD pipelines to catch vulnerable dependencies before deployment.

  3. Monitor transitive dependencies: The tar package here was a dependency of node-gyp. Use npm ls tar to identify where vulnerable versions enter your tree.

Defense in Depth

// Example: Additional input validation wrapper
const tar = require('tar');
const path = require('path');

async function safeExtract(archivePath, destDir) {
    // Pre-validate archive size
    const stats = await fs.stat(archivePath);
    if (stats.size > MAX_ARCHIVE_SIZE) {
        throw new Error('Archive exceeds size limit');
    }

    // Extract with timeout and resource limits
    const extractPromise = tar.extract({
        file: archivePath,
        cwd: destDir,
        // tar 7.5.21+ respects these additional safety options
        noPax: true,  // Disable extended attributes that can contain paths
        strict: true  // Fail on any parsing error
    });

    // Race against timeout
    return Promise.race([
        extractPromise,
        new Promise((_, reject) => 
            setTimeout(() => reject(new Error('Extraction timeout')), 30000)
        )
    ]);
}

Security Standards

Key Takeaways

  • Never assume patch-level dependencies are safe: CVE-2026-73566 exists in tar 7.5.19, a seemingly minor version behind 7.5.21. Automated scanning catches what manual review misses.

  • The tar package in node-gyp dependency chains requires explicit monitoring: Because node-gyp bundles tar for native module compilation, vulnerable versions can exist even in projects that don't directly use tar extraction.

  • Infinite loops in parsing logic are exploitable DoS vectors: When processing untrusted archive formats, always implement external timeouts and resource limits regardless of library security.

  • Upgrade paths for package-lock.json vulnerabilities must modify both files: Changing only package.json leaves lockfile inconsistencies. The automated PR correctly updates both with synchronized version bumps.

  • The integrity hash in package-lock.json serves as a tamper-evident seal: The SHA-512 change from 4LeEWl96twn... to XdhtCvlMyww... cryptographically verifies the package content difference between vulnerable and patched versions.

How Orbis AppSec Detected This

Source: User-influenced file upload data entering through HTTP request bodies containing tar archive uploads.

Sink: The tar.extract() and tar.x() API methods in the node_modules/tar package, specifically within the GNU LongLink header parsing logic that processes ././@LongLink entries.

Missing control: Absent bounds validation on LongLink header size fields before the extraction loop, allowing pathological path lengths to trigger unbounded iteration.

CWE: CWE-834 (Excessive Iteration) — the code enters a loop based on attacker-controlled size values without adequate termination conditions.

Fix: Upgraded tar from 7.5.19 to 7.5.21 in package.json and package-lock.json, which implements strict path length validation and guaranteed loop termination.

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-73566 demonstrates how even mature, widely-used packages like tar can harbor subtle DoS vulnerabilities in edge-case parsing logic. The 7.5.19 → 7.5.21 upgrade shows that security fixes don't require API changes—just rigorous input validation and defensive programming.

For Node.js developers, this case reinforces the importance of:
- Automated dependency scanning in CI/CD pipelines
- Understanding your transitive dependency tree
- Applying defense-in-depth with timeouts and resource limits

The patch is available now. If your package-lock.json shows tar at any version below 7.5.21, upgrade immediately—before an attacker sends your application into an infinite loop.

References

Frequently Asked Questions

What is CVE-2026-73566?

CVE-2026-73566 is a high-severity Denial of Service vulnerability in node-tar where archives with extremely long path names cause infinite loops during extraction, leading to CPU exhaustion.

How do you prevent Denial of Service via long-path tar archives in Node.js?

Upgrade tar to version 7.5.21 or later, which includes proper path length validation. Additionally, implement input validation on uploaded archives and consider resource limits on extraction operations.

What CWE is CVE-2026-73566?

CWE-834: Excessive Iteration — the vulnerability occurs when the extraction logic fails to properly terminate when encountering path names that exceed expected bounds.

Is input validation alone enough to prevent this vulnerability?

No. While input validation helps, the root cause is in the tar library itself. You must upgrade to tar 7.5.21+ as the primary defense, with input validation as a defense-in-depth measure.

Can static analysis detect CVE-2026-73566?

Yes. Dependency scanners like Trivy can detect vulnerable tar versions in package-lock.json, and SCA tools can flag the specific CVE pattern before exploitation.

View the Security Fix

Check out the pull request that fixed this vulnerability

View PR #84

Related Articles

high

How missing dependency update cooldowns happen in GitHub Dependabot configurations and how to fix it

A semgrep scan flagged `.github/dependabot.yml` for lacking a cooldown period, meaning Dependabot would immediately propose updates to brand-new package versions across npm, Bundler, and Docker ecosystems. The fix adds a `cooldown: default-days: 7` block to every `package-ecosystem` entry, forcing a one-week waiting period before newly published releases are considered — reducing exposure to malicious or unstable package drops.

high

How dependabot-missing-cooldown happens in GitHub Actions/Node.js and how to fix it

The repository's `.github/dependabot.yml` had no cooldown period configured, meaning Dependabot could immediately propose updates to newly published package versions with zero time for the community to flag malware or instability. The fix adds a `cooldown` block with `default-days: 7` to both the `npm` and `github-actions` ecosystems, forcing a 7-day waiting period before new releases are surfaced as update PRs.

high

How Path Traversal Happens in TensorFlow's Data Service and How to Fix It

TensorFlow's data service dispatcher validated dataset IDs against forward-slash traversal attacks but overlooked backslash characters on non-Windows platforms, allowing attackers to escape the root directory. A targeted fix adds explicit backslash validation across all platforms, closing a high-severity path traversal vulnerability in the snapshot management system.

critical

How Unbounded WebSocket Message Handling Causes Resource Exhaustion in Node.js and How to Fix It

The WebSocketCrossServerAdapter class in a popular Node.js WebSocket library lacked any rate limiting on inbound messages, allowing attackers to flood Redis nodes and WebSocket servers with high-volume traffic. The fix introduces a configurable `rateLimit` option that caps messages per connection per second, preventing resource exhaustion while preserving legitimate functionality.

critical

How Remote Code Execution Happens in Handlebars Template Compilation and How to Fix It

CVE-2026-33937 is a critical remote code execution vulnerability in Handlebars.js that allows attackers to execute arbitrary code by passing maliciously crafted Abstract Syntax Tree (AST) objects to the compile() function. The vulnerability was patched in version 4.7.9, and we've upgraded to protect against this threat vector.

critical

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

A critical Denial of Service vulnerability (CVE-2026-59873) in the `tar` npm package allowed attackers to craft malicious gzip archives that could exhaust memory or CPU during decompression. The fix upgrades `tar` from 7.5.11 to 7.5.21 across `package.json` and `package-lock.json`, closing the resource-exhaustion path without changing any application code.