HIGH 7.5

CVE-2026-59874: node-tar Infinite Loop Denial of Service

A vulnerability in node-tar, a popular Node.js library for handling tar archives, allows an attacker to craft a malicious tar file that causes the library to enter an infinite loop. When processing a specially crafted tar header with a negative file size encoded in base-256 format, the archive scanner fails to advance through the file and instead repeatedly re-parses the same header. This denial-of-service condition can hang or exhaust resources on systems that process untrusted tar archives. The issue affects all versions prior to 7.5.18.

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-835
Affected products
1 configuration(s)
Published / Modified
2026-07-08 / 2026-07-10

NVD description (verbatim)

node-tar is a tar archive manipulation library for Node.js. Prior to 7.5.18, tar.replace accepts a checksum-valid tar header with a negative base-256 encoded entry size, causing the archive scanner to make no progress while repeatedly parsing the same header. This issue is fixed in version 7.5.18.

4 reference(s) · View on NVD →

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

Technical summary

The vulnerability stems from improper validation of base-256 encoded entry sizes in tar headers. Tar archives use a specific format for file metadata, including size fields that can be encoded as base-256 numbers for large files. In affected versions of node-tar, the library fails to correctly validate negative values in these size fields. When tar.replace() encounters such a header, the scanner cannot determine a valid file boundary, causing it to loop indefinitely on the same header structure rather than progressing through the archive. This is classified as an infinite loop vulnerability (CWE-835) and results in a denial-of-service condition.

Business impact

Systems that automatically process tar archives—such as deployment pipelines, container image builders, package managers, or backup restoration tools—face availability risk. An attacker could supply a malicious tar file that, when processed by vulnerable node-tar versions, consumes CPU and blocks processing threads indefinitely. This could disrupt CI/CD workflows, prevent legitimate archive extraction, or cause service degradation in applications that handle user-uploaded tar files. Organizations relying on node-tar in production environments should treat this as a denial-of-service risk requiring prompt remediation.

Affected systems

The vulnerability affects node-tar (isaacs tar) versions prior to 7.5.18. Any application or service that directly or transitively depends on node-tar and processes tar archives—particularly untrusted or user-supplied archives—is at risk. This includes build tools, deployment systems, container platforms, and any Node.js application that extracts or manipulates tar files programmatically.

Exploitability

Exploitation requires no authentication or user interaction beyond providing a crafted tar archive to a vulnerable system. The attack surface is network-accessible if the application accepts remote tar file uploads or processes archives from untrusted sources. The barrier to exploitation is low: an attacker need only construct a tar header with a negative base-256 encoded size field, a straightforward task requiring knowledge of tar format structure but no sophisticated tooling. However, exploitation is limited to systems that actively process the malicious archive, making it a targeted denial-of-service vector rather than a widespread remote code execution risk.

Remediation

Upgrade node-tar to version 7.5.18 or later. Review your application's dependency tree to identify all direct and transitive uses of node-tar. Update package-lock.json or equivalent lock files and re-deploy. For applications unable to upgrade immediately, implement input validation upstream: reject tar archives with suspicious or malformed headers, or process archives in isolated environments with resource limits (CPU timeouts, thread pools) to prevent infinite loops from blocking critical services.

Patch guidance

Verify that your Node.js project's package.json permits node-tar 7.5.18 or higher, or update the version constraint accordingly. Run npm update or yarn upgrade to pull the patched version. If using a monorepo, ensure all workspaces and dependencies reference the fixed version. Test archive extraction with your application's typical workflows before deploying to production. If your project pins an older major version of node-tar, consult the upstream changelog to confirm compatibility before upgrading.

Detection guidance

Monitor for CPU spikes or hung processes associated with tar extraction operations. Log archive processing times; sustained extraction of a single archive with no data progress suggests the infinite loop condition. Implement application-level timeouts on archive operations and alert if extraction exceeds expected thresholds. Review tar files submitted by users for anomalous headers; tools like tar -tvf can preview headers and reveal suspicious size fields. In SIEM systems, flag processes spawning tar operations that consume CPU for extended periods without completing.

Why prioritize this

This vulnerability merits prompt patching because it combines low exploitation complexity with direct availability impact. While not a data breach vector, the denial-of-service mechanism is trivial to trigger and affects any system processing untrusted tar archives. Organizations with user-facing upload features or automated archive handling should prioritize this update. Severity is elevated (CVSS 7.5) because of the ease of exploitation and broad applicability of tar processing in modern development workflows.

Risk score, explained

CVSS 3.1 score of 7.5 (HIGH) reflects a network-accessible denial-of-service vulnerability with no authentication requirement and low attack complexity. The vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H indicates: network attack vector, low complexity, no privilege or user interaction required, and high availability impact. The score does not account for confidentiality or integrity compromise, as this is purely a resource exhaustion issue. Organizations should not underestimate this score; while not critical, HIGH-severity DoS vulnerabilities in widely-used libraries warrant immediate attention.

Frequently asked questions

Could an attacker use this to steal data or execute code?

No. This vulnerability causes denial of service only—the infinite loop consumes resources but does not lead to information disclosure or code execution. However, an attacker could use it to disrupt service availability or block legitimate archive processing.

Do I need to update if my application only reads tar files and never modifies them?

Yes. The vulnerability affects tar.replace(), but any use of node-tar functions to parse or iterate through archive entries may be affected if the archive contains a malicious header. Upgrade to 7.5.18 regardless of how your application uses the library.

What if I can't upgrade immediately?

Implement short timeouts on archive processing operations and run extraction in resource-limited containers or sandboxes. Validate tar headers before processing and reject files with suspicious metadata. These mitigations reduce risk but do not fully eliminate it; prioritize upgrading as soon as feasible.

Is this vulnerability being actively exploited?

The vulnerability is not currently listed as known exploited in the wild, but it is straightforward to exploit. Treat it as a high-priority patch regardless of real-world exploitation status, especially if your service accepts user-uploaded archives.

This analysis is provided for informational purposes and reflects the state of the vulnerability as of the publication and modification dates. CVSS scores and severity ratings are based on vendor-supplied data and should be validated against your organization's risk model and threat environment. Patch availability and version numbers should be verified against the official isaacs/tar repository and npm package registry. This explainer does not constitute legal or compliance advice. Organizations should apply standard change management and testing procedures before deploying patches to production systems. Source: NVD (public-domain), retrieved 2026-08-17. Analysis generated by SEC.co (claude-haiku-4-5).