CVE-2024-12905
tar-fs Vulnerable to Link Following and Path Traversal via Extracting a Crafted tar File
An Improper Link Resolution Before File Access ("Link Following") and Improper Limitation of a Pathname to a Restricted Directory ("Path Traversal"). This vulnerability occurs when extracting a maliciously crafted tar file, which can result in unauthorized file writes or overwrites outside the intended extraction directory. The issue is associated with index.js in the tar-fs package.
This issue affects tar-fs: from 0.0.0 before 1.16.4, from 2.0.0 before 2.1.2, from 3.0.0 before 3.0.8.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- 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
7.5
An Improper Link Resolution Before File Access ("Link Following") and Improper Limitation of a Pathname to a Restricted Directory ("Path Traversal"). This vulnerability occurs when extracting a maliciously crafted tar file, which can result in unauthorized file writes or overwrites outside the intended extraction directory. The issue is associated with index.js in the tar-fs package.
This issue affects tar-fs: from 0.0.0 before 1.16.4, from 2.0.0 before 2.1.2, from 3.0.0 before 3.0.8.
- Record
CVE-2024-12905- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-59, CWE-22
- Updated
- 2026-11-02
EUVDEUVD-2024-54315
7.5
An Improper Link Resolution Before File Access ("Link Following") and Improper Limitation of a Pathname to a Restricted Directory ("Path Traversal"). This vulnerability occurs when extracting a maliciously crafted tar file, which can result in unauthorized file writes or overwrites outside the intended extraction directory. The issue is associated with index.js in the tar-fs package.
This issue affects tar-fs: from 0.0.0 before 1.16.4, from 2.0.0 before 2.1.2, from 3.0.0 before 3.0.8.
- Record
EUVD-2024-54315- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-pq67-2wwv-3xjx
7.5
tar-fs Vulnerable to Link Following and Path Traversal via Extracting a Crafted tar File
An Improper Link Resolution Before File Access ("Link Following") and Improper Limitation of a Pathname to a Restricted Directory ("Path Traversal"). This vulnerability occurs when extracting a maliciously crafted tar file, which can result in unauthorized file writes or overwrites outside the intended extraction directory. The issue is associated with index.js in the tar-fs package.
This issue affects tar-fs: from 0.0.0 before 1.16.4, from 2.0.0 before 2.1.2, from 3.0.0 before 3.0.7.
PoC
// Create a writable stream to extract the tar content
const extractStream = tarfs.extract('/', {
// We can ignore the file type checks to allow the extraction of the malicious file
ignore: (name) => false,
});
// Create a tar stream
const tarStream = tarfs.pack().on('error', (err) => {
throw err;
});
// Append the malicious entry to the tar stream
tarStream.entry({ name: '/flag.txt', mode: 0o644 }, Buffer.from('This is a flag!'));
// Finalize the tar stream
tarStream.finalize();
// Pipe the tar stream into the extract stream
tarStream.pipe(extractStream);
- Record
GHSA-pq67-2wwv-3xjx- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-22
- Updated
- 2026-11-02
NVD
7.5
An Improper Link Resolution Before File Access ("Link Following") and Improper Limitation of a Pathname to a Restricted Directory ("Path Traversal"). This vulnerability occurs when extracting a maliciously crafted tar file, which can result in unauthorized file writes or overwrites outside the intended extraction directory. The issue is associated with index.js in the tar-fs package.
This issue affects tar-fs: from 0.0.0 before 1.16.4, from 2.0.0 before 2.1.2, from 3.0.0 before 3.0.8.
- Record
CVE-2024-12905- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-22, CWE-59
- Updated
- 2026-11-02
OSV
7.5
An Improper Link Resolution Before File Access ("Link Following") and Improper Limitation of a Pathname to a Restricted Directory ("Path Traversal"). This vulnerability occurs when extracting a maliciously crafted tar file, which can result in unauthorized file writes or overwrites outside the intended extraction directory. The issue is associated with index.js in the tar-fs package.
This issue affects tar-fs: from 0.0.0 before 1.16.4, from 2.0.0 before 2.1.2, from 3.0.0 before 3.0.8.
- Record
CVE-2024-12905- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-22, CWE-59
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2024-12905
7.5
An Improper Link Resolution Before File Access ("Link Following") and Improper Limitation of a Pathname to a Restricted Directory ("Path Traversal"). This vulnerability occurs when extracting a maliciously crafted tar file, which can result in unauthorized file writes or overwrites outside the intended extraction directory. The issue is associated with index.js in the tar-fs package. This issue affects tar-fs: from 0.0.0 before 1.16.4, from 2.0.0 before 2.1.2, from 3.0.0 before 3.0.8.
- Record
DEBIAN-CVE-2024-12905- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Updated
- 2026-11-02
Show 9 moreShow less
OSVGHSA-pq67-2wwv-3xjx
7.5
tar-fs Vulnerable to Link Following and Path Traversal via Extracting a Crafted tar File
An Improper Link Resolution Before File Access ("Link Following") and Improper Limitation of a Pathname to a Restricted Directory ("Path Traversal"). This vulnerability occurs when extracting a maliciously crafted tar file, which can result in unauthorized file writes or overwrites outside the intended extraction directory. The issue is associated with index.js in the tar-fs package.
This issue affects tar-fs: from 0.0.0 before 1.16.4, from 2.0.0 before 2.1.2, from 3.0.0 before 3.0.7.
PoC
// Create a writable stream to extract the tar content
const extractStream = tarfs.extract('/', {
// We can ignore the file type checks to allow the extraction of the malicious file
ignore: (name) => false,
});
// Create a tar stream
const tarStream = tarfs.pack().on('error', (err) => {
throw err;
});
// Append the malicious entry to the tar stream
tarStream.entry({ name: '/flag.txt', mode: 0o644 }, Buffer.from('This is a flag!'));
// Finalize the tar stream
tarStream.finalize();
// Pipe the tar stream into the extract stream
tarStream.pipe(extractStream);
- Record
GHSA-pq67-2wwv-3xjx- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-22
- Updated
- 2026-11-02
OSVROOT-APP-NPM-CVE-2024-12905
7.5
CVE-2024-12905 in tar-fs - Patched by Root
Root has patched CVE-2024-12905 in the tar-fs package for Root:npm. Multiple fixed versions available.
- Record
ROOT-APP-NPM-CVE-2024-12905- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Updated
- 2026-11-06
OSVUBUNTU-CVE-2024-12905
7.5
An Improper Link Resolution Before File Access ("Link Following") and Improper Limitation of a Pathname to a Restricted Directory ("Path Traversal"). This vulnerability occurs when extracting a maliciously crafted tar file, which can result in unauthorized file writes or overwrites outside the intended extraction directory. The issue is associated with index.js in the tar-fs package. This issue affects tar-fs: from 0.0.0 before 1.16.4, from 2.0.0 before 2.1.2, from 3.0.0 before 3.0.8.
- Record
UBUNTU-CVE-2024-12905- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Updated
- 2026-11-02
OSVAZL-59367 No score
CVE-2024-12905 affecting package reaper for versions less than 3.1.1-18
An Improper Link Resolution Before File Access ("Link Following") and Improper Limitation of a Pathname to a Restricted Directory ("Path Traversal"). This vulnerability occurs when extracting a maliciously crafted tar file, which can result in unauthorized file writes or overwrites outside the intended extraction directory. The issue is associated with index.js in the tar-fs package.
This issue affects tar-fs: from 0.0.0 before 1.16.4, from 2.0.0 before 2.1.2, from 3.0.0 before 3.0.8.
- Record
AZL-59367- Updated
- 2026-11-02
OSVCLSA-2026-1774484497 No score
TuxCare security update for tar-fs (5 CVEs)
TuxCare rebuilt tar-fs to address 5 CVEs. Fixed in 1.5.1-tuxcare.1.
- Record
CLSA-2026-1774484497- Updated
- 2026-11-02
OSVCLSA-2026-1788560472 No score
TuxCare security update for tar-fs (3 CVEs)
TuxCare rebuilt tar-fs to address 3 CVEs. Fixed in 3.0.4-tuxcare.1.
- Record
CLSA-2026-1788560472- Updated
- 2026-11-02
OSVCLSA-2026-1790963499 No score
TuxCare security update for tar-fs (3 CVEs)
TuxCare rebuilt tar-fs to address 3 CVEs. Fixed in 2.1.1-tuxcare.1.
- Record
CLSA-2026-1790963499- Updated
- 2026-11-02
OSVMGASA-2025-0194 No score
Updated yarnpkg packages fix security vulnerabilities
CVE-2024-37890 yarnpkg: denial of service when handling a request with many HTTP headers. CVE-2024-48949 yarnpkg: Missing Validation in Elliptic's EDDSA Signature Verification. CVE-2024-12905 yarnpkg: link following and path traversal via maliciously crafted tar file And other vulnerabilities in the yarn's bundled nodejs components are fixed too, see the references.
- Record
MGASA-2025-0194- Updated
- 2026-11-02
OSVUSN-8367-1 No score
node-tar-fs vulnerabilities
It was discovered that tar-fs did not properly limit paths when extracting crafted tar files. An attacker could possibly use this issue to write or overwrite files outside the intended extraction directory. This issue only affected Ubuntu 22.04 LTS and Ubuntu 24.04 LTS. (CVE-2024-12905)
It was discovered that tar-fs did not properly validate extraction paths for certain crafted tar archives. An attacker could possibly use this issue to write files outside the intended extraction directory. This issue only affected Ubuntu 22.04 LTS and Ubuntu 24.04 LTS. (CVE-2025-48387)
It was discovered that tar-fs had a symlink validation bypass when extracting crafted tar files. An attacker could possibly use this issue to write files outside the intended extraction directory. (CVE-2025-59343)
- Record
USN-8367-1- Updated
- 2026-11-02
Affected packages
| Package | Affected | Fixed |
|---|---|---|
tar-fsnpm |
before 1.16.4 | 1.16.4 |
tar-fsnpm |
2.0.0 up to 2.1.2 | 2.1.2 |
tar-fsnpm |
3.0.0 up to 3.0.7 | 3.0.7 |
reaperAzure Linux:2 |
before 3.1.1-18 | 3.1.1-18 |
tar-fsTuxCare:npm From an advisory covering 4 CVEs |
1.5.1-tuxcare.0 up to 1.5.1-tuxcare.1, plus listed versions 1.5.1 |
1.5.1-tuxcare.1 |
tar-fsTuxCare:npm From an advisory covering 3 CVEs |
3.0.4-tuxcare.0 up to 3.0.4-tuxcare.1, plus listed versions 3.0.4 |
3.0.4-tuxcare.1 |
tar-fsTuxCare:npm From an advisory covering 3 CVEs |
2.1.1-tuxcare.0 up to 2.1.1-tuxcare.1, plus listed versions 2.1.1 |
2.1.1-tuxcare.1 |
node-tar-fsDebian:12 |
before 2.1.3-0+deb12u1, plus listed versions 2.1.1-6 |
2.1.3-0+deb12u1 |
node-tar-fsDebian:13 |
before 3.0.8+~cs2.0.4-1 | 3.0.8+~cs2.0.4-1 |
node-tar-fsDebian:14 |
before 3.0.8+~cs2.0.4-1 | 3.0.8+~cs2.0.4-1 |
Show 9 moreShow less
| Package | Affected | Fixed |
|---|---|---|
node-tar-fsDebian:11 From an advisory covering 2 CVEs |
before 2.1.3-0+deb11u1, plus listed versions 2.1.1-22.1.1-32.1.1-42.1.1-6 |
2.1.3-0+deb11u1 |
yarnpkgMageia:9 From an advisory covering 11 CVEs |
before 1.22.22-0.10.9.2.1.mga9 | 1.22.22-0.10.9.2.1.mga9 |
tar-fsRoot:npm |
before 3.0.6-aikido.2 | 3.0.6-aikido.22.0.0-aikido.41.16.3-aikido.12.1.2-aikido.12.1.2-aikido.2 |
@rootio/tar-fsRoot:npm |
before 3.0.6-root.io.1 | 3.0.6-root.io.12.0.0-root.io.12.0.0-root.io.22.0.0-root.io.32.0.0-root.io.43.0.6-root.io.21.16.3-root.io.12.1.2-root.io.12.1.2-root.io.2 |
node-tar-fsUbuntu:Pro:22.04:LTS |
before 2.1.1-6ubuntu0.22.04.1~esm1, plus listed versions 2.1.1-22.1.1-42.1.1-6 |
2.1.1-6ubuntu0.22.04.1~esm1 |
node-tar-fsUbuntu:Pro:24.04:LTS |
before 2.1.1-6ubuntu0.24.04.1~esm1, plus listed versions 2.1.1-6 |
2.1.1-6ubuntu0.24.04.1~esm1 |
node-tar-fsUbuntu:Pro:22.04:LTS From an advisory covering 3 CVEs |
before 2.1.1-6ubuntu0.22.04.1~esm1, plus listed versions 2.1.1-22.1.1-42.1.1-6 |
2.1.1-6ubuntu0.22.04.1~esm1 |
node-tar-fsUbuntu:Pro:24.04:LTS From an advisory covering 3 CVEs |
before 2.1.1-6ubuntu0.24.04.1~esm1, plus listed versions 2.1.1-6 |
2.1.1-6ubuntu0.24.04.1~esm1 |
node-tar-fsUbuntu:25.10 From an advisory covering 3 CVEs |
before 3.0.9+~cs2.0.4-1+deb13u1build0.25.10.1, plus listed versions 2.1.1-63.0.8+~cs2.0.4-13.0.9+~cs2.0.4-1 |
3.0.9+~cs2.0.4-1+deb13u1build0.25.10.1 |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| Exploit-DB | tar-fs 3.0.0 - Arbitrary File Write/Overwrite | 2025-04-22 |
| PoC in GitHub | theMcSam/CVE-2024-12905-PoC | 2025-04-24 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected | OSV | |
| affected, facts | ||
| first indexed | CVE List, EUVD, Exploit-DB, GitHub Advisories, NVD, OSV, PoC in GitHub |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2024-12905 is a high vulnerability (CVSS 7.5) in tar-fs, published March 27, 2025. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 2.30%, the 83rd percentile. Fixed in tar-fs 1.16.4.
References
github.com/mafintosh/tar-fs/commit/a1dd7e7c7f4b4a8bd2ab60f513baca573b44e2ed
seal.security/blog/a-link-to-the-past-uncovering-a-new-vulnerability-in-tar-fs
lists.debian.org/debian-lts-announce/2025/06/msg00012.html
nvd.nist.gov/vuln/detail/CVE-2024-12905
arxiv.org/abs/2506.04962
arxiv.org/pdf/2506.04962
Show 14 moreShow less
github.com/advisories/GHSA-pq67-2wwv-3xjx
registry.npmjs.org
github.com/CVEProject/cvelistV5/tree/main/cves/2024/12xxx/CVE-2024-12905.json
github.com/mafintosh/tar-fs
security-tracker.debian.org/tracker/CVE-2024-12905
advisories.mageia.org/MGASA-2025-0194.html
bugs.mageia.org/show_bug.cgi?id=33674
lists.fedoraproject.org/archives/list/[email protected]/message/2UGLXZO6VIHGIITQTEUY5Q5YCAP2A4ZP
lists.fedoraproject.org/archives/list/[email protected]/message/VEDIJM7VQF4Q2L2KKQ6KJ2WZNR7AXYQD
ubuntu.com/security/CVE-2024-12905
cve.org/CVERecord?id=CVE-2024-12905
ubuntu.com/security/notices/USN-8367-1
ubuntu.com/security/CVE-2025-48387
ubuntu.com/security/CVE-2025-59343