Every CVE Search/ Get API key

CVE-2024-12905

tar-fs Vulnerable to Link Following and Path Traversal via Extracting a Crafted tar File

7.5 HighPublic exploitFix available

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

2.30%Up 2.3 points since Mar 28, 2025
90%50%10%1%

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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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

Affected packages
PackageAffectedFixed
tar-fs
npm
before 1.16.4
1.16.4
tar-fs
npm
2.0.0 up to 2.1.2
2.1.2
tar-fs
npm
3.0.0 up to 3.0.7
3.0.7
reaper
Azure Linux:2
before 3.1.1-18
3.1.1-18
tar-fs
TuxCare: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-fs
TuxCare: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-fs
TuxCare: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-fs
Debian:12
before 2.1.3-0+deb12u1, plus listed versions
2.1.1-6
2.1.3-0+deb12u1
node-tar-fs
Debian:13
before 3.0.8+~cs2.0.4-1
3.0.8+~cs2.0.4-1
node-tar-fs
Debian:14
before 3.0.8+~cs2.0.4-1
3.0.8+~cs2.0.4-1
Show 9 moreShow less
Affected packages
PackageAffectedFixed
node-tar-fs
Debian: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
yarnpkg
Mageia: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-fs
Root: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-fs
Root: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-fs
Ubuntu: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-fs
Ubuntu: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-fs
Ubuntu: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-fs
Ubuntu: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-fs
Ubuntu: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.

Public exploits
SourceLinkDate
Exploit-DBtar-fs 3.0.0 - Arbitrary File Write/Overwrite2025-04-22
PoC in GitHubtheMcSam/CVE-2024-12905-PoC2025-04-24

History

History
RecordedChangedSources
affectedOSV
affected, facts
first indexedCVE 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

Show 14 moreShow less
MoveEnter Open