CVE-2025-48387 tar-fs has issue where extract can write outside the specified dir with a specific tarball
Attackers can write files outside the intended directory using a malicious tarball, affecting applications using the tar-fs library.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-48387?
CVE-2025-48387 is a high-severity path traversal vulnerability in mafintosh tar-fs, published on 2 Jun 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
tar-fs provides filesystem bindings for tar-stream. Versions prior to 3.0.9, 2.1.3, and 1.16.5 have an issue where an extract can write outside the specified dir with a specific tarball. This has been patched in versions 3.0.9, 2.1.3, and 1.16.5. As a workaround, use the ignore option to ignore non files/directories.
Weakness: CWE-22
Which versions are affected by CVE-2025-48387?
6 open source packages ship an affected version, including tar-fs.
| Package | Affected | Fixed in |
|---|---|---|
tar-fs npm | All versions | 1.16.5 |
tar-fs npm | All versions | 1.16.5 |
tar-fs npm | From 2.0.0 | 2.1.3 |
tar-fs npm | From 2.0.0 | 2.1.3 |
tar-fs npm | From 3.0.0 | 3.0.9 |
tar-fs npm | From 3.0.0 | 3.0.9 |
How do I fix CVE-2025-48387?
Upgrade tar-fs to a fixed version for your release line: 1.16.5, 2.1.3 or 3.0.9.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2025-48387 being exploited?
There is no known exploitation of CVE-2025-48387 in the wild and no public exploit code.
Sources
Also known as AZL-62236, DEBIAN-CVE-2025-48387, ECHO-bd2e-0f41-afca, GHSA-8cj5-5rvv-wf4v, MINI-6v26-v72m-jxpp, MINI-ffp8-j64x-9672 and 4 more.