# CVE-2026-31802: node-tar symlink path traversal via drive-relative linkpath

Source: https://junglewise.ai/threats/cve-2026-31802-node-tar-symlink-path-traversal-via-drive-relative-linkpath  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-03-10. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-31802 · Severity: medium · CVSS 4 · Published 2026-03-10

node-tar is a Node.js library used to extract and create tar archives, commonly used in build systems and package management. A flaw in symlink handling allows an attacker to craft a malicious tar file that creates symlinks pointing outside the intended extraction directory, enabling arbitrary file overwrite with the permissions of the extracting process. This could compromise build pipelines, services processing user-supplied archives, or CLI tools.

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

## Quick answers

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

**How severe is CVE-2026-31802?** Medium severity, with a CVSS score of 4, published 10 March 2026.

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

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

**How is CVE-2026-31802 attacked?** It is attacked with local access, in a software library.

**Am I affected by CVE-2026-31802?** 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.11 or later

  ```sh
  npm install tar@7.5.11
  ```


## Technical details

This is a symlink path traversal vulnerability in the tar extraction logic. The vulnerable code in Unpack[STRIPABSOLUTEPATH] validates path traversal attempts (..) against a resolved path that still contains the original drive-relative value (e.g., "C:../../../target.txt"), but after validation rewrites the path to the stripped form ("../../../target.txt"). When the symlink is created, it uses the rewritten relative path, which when evaluated from within a nested directory structure (e.g., "a/b/l"), successfully escapes the extraction root. The attack is reachable during normal tar.x({ cwd, file }) extraction of attacker-controlled archives and requires no authentication or special privileges. Patch version 7.5.11 addresses the issue.

## Affected products

- npm tar <= 7.5.10

## Identifiers

- CVE-2026-31802
- GHSA-9ppj-qmqm-q256

## Timeline

- 2026-03-09: disclosed
- 2026-03-09: patched: Version 7.5.11 released

## References

- [https://github.com/isaacs/node-tar/security/advisories/GHSA-9ppj-qmqm-q256](https://github.com/isaacs/node-tar/security/advisories/GHSA-9ppj-qmqm-q256)

## 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 infinite loop in tar.replace](https://junglewise.ai/threats/cve-2026-59874-isaacs-node-tar-infinite-loop-in-tar-replace)
- [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)
