CVE-2025-48387 tar-fs has issue where extract can write outside the specified dir with a specific tarball

High 8.7 Published Updated

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.

PackageAffectedFixed in
tar-fs npmAll versions1.16.5
tar-fs npmAll versions1.16.5
tar-fs npmFrom 2.0.02.1.3
tar-fs npmFrom 2.0.02.1.3
tar-fs npmFrom 3.0.03.0.9
tar-fs npmFrom 3.0.03.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.

Is CVE-2025-48387 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free