Critical Directory Traversal Vulnerability in node-tar-fs Package

node-tar-fs Updated 02 Oct 2025

Summary

02/06/2025
N/A
Yes i
Unrated
Not published

CVE-2025-48387: tar-fs provides filesystem bindings for tar-stream. Affects node-tar-fs across 2 version ranges.

< 2.1.3-0+deb11u1 < 647447b572bc135c41035e82ca7b894f02b17f0f

Fixed in 2.1.3-0+deb11u1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The node-tar-fs package provides filesystem bindings for the tar-stream module, allowing users to extract tar files directly to the filesystem. It is commonly used in Node.js applications for handling tar archives. However, certain versions of this package are vulnerable to a directory traversal issue that can lead to unauthorized file writes outside the intended directory.

Vulnerability Detail

The vulnerability identified as CVE-2025-48387 affects versions of node-tar-fs prior to 3.0.9, 2.1.3, and 1.16.5. It allows an attacker to craft a malicious tarball that, when extracted, can write files outside the specified extraction directory. This can lead to data corruption, unauthorized access to sensitive files, and potential system compromise. The issue arises from improper validation of file paths during the extraction process.

How To Fix

Minimum fixed version

2.1.3-0+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade node-tar-fs

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, you can use the ignore option to ignore non-file or non-directory entries during extraction. This can be implemented in your extraction code as follows:

const tar = require('tar-fs');

tar.extract('destination-directory', { ignore: (name) => { return !isFileOrDirectory(name);

} });

Conclusion

The CVE-2025-48387 vulnerability in the node-tar-fs package poses significant risks due to its directory traversal nature. Users are strongly advised to update to the patched versions or implement the provided workaround to safeguard their applications.

See every vulnerability recorded for node-tar-fs →

Share this vulnerability

FAQ

CVE-2025-48387 is a critical vulnerability in the node-tar-fs package that allows for directory traversal, enabling malicious tarballs to write files outside the intended directory.

Versions prior to 3.0.9, 2.1.3, and 1.16.5 of the node-tar-fs package are affected by this vulnerability.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

If immediate updates are not possible, implement the provided workaround using the ignore option to mitigate the risk of exploitation.

Exploitation of this vulnerability can lead to unauthorized file access, data corruption, and potential system compromise, making it critical to address.

Related vulnerabilities

Recent vulnerabilities recorded for node-tar-fs.

How To Fix

Minimum fixed version

2.1.3-0+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade node-tar-fs

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback