# CVE-2026-59874: isaacs node-tar infinite loop in tar.replace

Source: https://junglewise.ai/threats/cve-2026-59874-isaacs-node-tar-infinite-loop-in-tar-replace  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-08. Updated: 2026-07-20  
License: CC BY 4.0 with a link back

CVE-2026-59874 · Severity: high · CVSS 7.5 · Published 2026-07-08

A vulnerability in the node-tar library, used for handling compressed archive files, can allow an attacker to crash or freeze an application. By providing a specially crafted archive file with a negative size value, an attacker can force the software into an infinite loop. This results in a denial-of-service (DoS) condition where the system becomes unresponsive and cannot process other tasks.

Technologies: [tar (npm)](https://junglewise.ai/threats/technologies/npm-tar). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2026-59874 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-59874 being exploited in the wild.

**How severe is CVE-2026-59874?** High severity, with a CVSS score of 7.5, published 8 July 2026.

**Which products and versions are affected?** tar (npm) SEMVER:introduced=0,fixed=7.5.18.

**Is there a fix for CVE-2026-59874?** Yes. tar (npm): upgrade to 7.5.18 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-59874 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-59874?** Check whether you run tar (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- tar (npm): upgrade to 7.5.18 or later

  ```sh
  npm install tar@7.5.18
  ```


## Technical details

The vulnerability is an infinite loop (CWE-835) within the `tar.replace()` API of node-tar. When scanning an existing archive to append new entries, the library parses tar headers and advances the file position based on the entry size. An attacker can craft a header using base-256 encoding to specify a negative entry size (e.g., -512). When the library adds the standard 512-byte header offset to this negative size, the net progress is zero, causing the scanner to repeatedly parse the same header. This can be exploited if an application performs replacement operations on attacker-controlled archives. The issue is fixed in version 7.5.18.

## Affected products

- isaacs/node-tar tar <= 7.5.17

## Identifiers

- CVE-2026-59874
- GHSA-8x88-c5mf-7j5w

## Timeline

- 2026-06-27: patched: Fix released in version 7.5.18
- 2026-07-08: advisory: NVD published CVE-2026-59874
- 2026-07-20: disclosed: GitHub Advisory GHSA-8x88-c5mf-7j5w published

## References

- [https://api.github.com/users/Jvr2022](https://api.github.com/users/Jvr2022)
- [https://github.com/Jvr2022](https://github.com/Jvr2022)
- [https://api.github.com/users/Jvr2022/gists%7B/gist_id%7D](https://api.github.com/users/Jvr2022/gists%7B/gist_id%7D)
- [https://api.github.com/users/Jvr2022/repos](https://api.github.com/users/Jvr2022/repos)
- [https://avatars.githubusercontent.com/u/109031036?v=4](https://avatars.githubusercontent.com/u/109031036?v=4)
- [https://api.github.com/users/Jvr2022/events%7B/privacy%7D](https://api.github.com/users/Jvr2022/events%7B/privacy%7D)

## Related threats

- [npm tar stack overflow in mapHas filter with long paths](https://junglewise.ai/threats/cve-2026-73566-npm-tar-stack-overflow-in-maphas-filter-with-long-paths)
- [node-tar denial of service via NUL byte in PAX records](https://junglewise.ai/threats/cve-2026-59875-node-tar-denial-of-service-via-nul-byte-in-pax-records)
- [isaacs node-tar Denial of Service via Gzip Bomb](https://junglewise.ai/threats/cve-2026-59873-isaacs-node-tar-denial-of-service-via-gzip-bomb)
- [isaacs node-tar denial of service via PAX numeric path type confusion](https://junglewise.ai/threats/cve-2026-59871-isaacs-node-tar-denial-of-service-via-pax-numeric-path-type)
- [isaacs node-tar interpretation conflict in PAX header parsing](https://junglewise.ai/threats/cve-2026-53655-isaacs-node-tar-interpretation-conflict-in-pax-header-parsing)
