# CVE-2026-31802: node-tar Symlink Path Traversal via Drive-Relative Linkpath

> Attackers can overwrite files outside the extraction directory by crafting tar archives with drive-relative symlink targets in node-tar.

- **Severity:** High 8.2 (`CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:H/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 9 Mar 2026
- **Updated:** 10 Mar 2026
- **Also known as:** AZL-101781, CLEANSTART-2026-DZ05381, CLEANSTART-2026-NW62895, CLSA-2026-1776731786, DEBIAN-CVE-2026-31802, ECHO-4999-d2de-3586, GHSA-9ppj-qmqm-q256, MINI-2774-67jv-4hwq, MINI-2c3c-rr49-cw8v, MINI-2r4m-xgqf-3vc9, MINI-389j-h7h8-88cx, MINI-3fg9-x6c9-gc5q, MINI-4ccx-cvj8-j3gw, MINI-4gfx-r86g-r7xh, MINI-62r3-7v8r-xx88, MINI-6qw2-f55h-gmxx, MINI-7m27-gmwv-m29q, MINI-9756-fjw7-g3g6, MINI-9rvr-9jvj-8rvr, MINI-fcj3-c4cj-84mg, MINI-fcp7-g2jg-j4xw, MINI-h4v2-gvq5-f89q, MINI-j948-p24m-7rgh, MINI-jmh9-wpwp-r3c7, MINI-mrrg-c7v9-wfc2, MINI-q28v-g45g-x8mf, MINI-q2hq-2xg3-gm49, MINI-rcc9-j5r4-w3p3, MINI-w694-6vrf-q9vc, MINI-w6hf-2pp7-7r8p, MINI-w7r6-f568-wg9w, MINI-wj4j-vv6m-9xmh, MINI-wjx8-r2mf-547m, MINI-wx75-vgrh-46r4, ROOT-APP-NPM-CVE-2026-31802, UBUNTU-CVE-2026-31802

## What is CVE-2026-31802?

CVE-2026-31802 is a high-severity path traversal vulnerability in isaacs node-tar, published on 9 Mar 2026. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

node-tar is a full-featured Tar for Node.js. Prior to version 7.5.11, tar (npm) can be tricked into creating a symlink that points outside the extraction directory by using a drive-relative symlink target such as C:../../../target.txt, which enables file overwrite outside cwd during normal tar.x() extraction. This vulnerability is fixed in 7.5.11.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2026-31802?

2 open source packages ship an affected version, including tar. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `tar` | npm | All versions | 7.5.11 |
| `tar` | npm | All versions | 7.5.11 |

Products: Isaacs Tar.

## How do I fix CVE-2026-31802?

Upgrade tar to 7.5.11 or later.

## Is CVE-2026-31802 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-31802 exists.

Public exploit code:

- PoC and write-up for CVE-2026-31802, a symlink path traversal vulnerability in npm tar enabling arbitrary file overwrite outside the extraction directory. (github_poc): https://github.com/Jvr2022/CVE-2026-31802
- Demonstrate and analyze the CVE-2026-31802 path traversal vulnerability in npm tar, enabling arbitrary file overwrite via symlink extraction. (github_poc): https://github.com/Recorded-texteditor120/CVE-2026-31802
- Scanner: CVE-2026-31802 npm tar path traversal — Python checker for arbitrary file write via npm pack (github_poc): https://github.com/ridhinva/npm-tar-path-traversal-scanner

## Other vulnerabilities in isaacs node-tar

- [CVE-2026-59873](https://insights.sbomify.com/CVE-2026-59873/): node-tar: Decompression/parse DoS via unlimited input (critical 9.2)
- [CVE-2026-23950](https://insights.sbomify.com/CVE-2026-23950/): node-tar has Race Condition in Path Reservations via Unicode Ligature Collisions on macOS APFS (high 8.8)
- [CVE-2026-59874](https://insights.sbomify.com/CVE-2026-59874/): node-tar: Negative tar entry size causes infinite loop in archive replace (high 8.7)
- [CVE-2026-29786](https://insights.sbomify.com/CVE-2026-29786/): node-tar: Hardlink Path Traversal via Drive-Relative Linkpath (high 8.2)
- [CVE-2026-24842](https://insights.sbomify.com/CVE-2026-24842/): node-tar Vulnerable to Arbitrary File Creation/Overwrite via Hardlink Path Traversal (high 8.2)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-31802 and fix it if it is affected.

What it is: CVE-2026-31802 is a high-severity path traversal vulnerability in isaacs node-tar, published on 9 Mar 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-31802 exists.

Affected packages and fixed versions:
- tar (npm): affected all versions; fixed in 7.5.11
- tar (npm): affected all versions; fixed in 7.5.11

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-31802/ (Markdown: https://insights.sbomify.com/CVE-2026-31802/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-31802
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-31802
- OSV: https://osv.dev/vulnerability/CVE-2026-31802

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-31802/
Summaries are generated and may contain mistakes; the official description above is the record.
