CVE-2025-48387: tar-fs has issue where extract can write outside the specified dir with a specific tarball
Impact v3.0.8, v2.1.2, v1.16.4 and below
Patches Has been patched in 3.0.9, 2.1.3, and 1.16.5
Workarounds You can use the ignore option to ignore non files/directories.
js ignore (, header) { // pass files & directories, ignore e.g. symlinks return header.type !== 'file' && header.type !== 'directory' }
Credit Thank you Caleb Brown from Google Open Source Security Team for reporting this in detail.
Other sources
tar-fs has issue where extract can write outside the specified dir with a specific tarball
— Microsoft
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.
— NVD
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2025-48387?
CVE-2025-48387 has a moderate severity due to its potential to allow unauthorized file writes outside the specified directory.
How do I fix CVE-2025-48387?
To fix CVE-2025-48387, upgrade to tar-fs versions 3.0.9, 2.1.3, or 1.16.5 that contain the patch.
What versions are affected by CVE-2025-48387?
CVE-2025-48387 affects tar-fs versions prior to 3.0.9, 2.1.3, and 1.16.5.
What is the main issue in CVE-2025-48387?
The main issue in CVE-2025-48387 is that an extract operation can write files outside the intended directory with a malicious tarball.
Is there a workaround for CVE-2025-48387?
A temporary workaround for CVE-2025-48387 is to use the ignore option when performing extractions.