Skip to main content

CVE-2025-48387: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in mafintosh tar-fs

High
VulnerabilityCVE-2025-48387cvecve-2025-48387cwe-22
Published: Mon Jun 02 2025 (06/02/2025, 19:20:18 UTC)
Source: CVE Database V5
Vendor/Project: mafintosh
Product: tar-fs

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.

AI-Powered Analysis

AILast updated: 08/22/2025, 00:53:33 UTC

Technical Analysis

CVE-2025-48387 is a high-severity path traversal vulnerability (CWE-22) affecting the 'tar-fs' library, which provides filesystem bindings for the 'tar-stream' module. The vulnerability exists in versions prior to 3.0.9, 2.1.3, and 1.16.5 of tar-fs. Specifically, when extracting tarballs, a crafted archive can cause files to be written outside the intended extraction directory. This occurs due to improper limitation of pathnames, allowing an attacker to escape the target directory and overwrite arbitrary files on the filesystem. The vulnerability does not require authentication, user interaction, or privileges, and can be exploited remotely if an attacker can supply a malicious tarball to a system using an affected version of tar-fs. The issue has been patched in the specified versions, and a temporary workaround involves using the 'ignore' option to skip non-file and non-directory entries during extraction. The CVSS 4.0 base score is 8.7, reflecting a network attack vector, low attack complexity, no privileges or user interaction required, no confidentiality or availability impact, but high integrity impact due to arbitrary file writes. No known exploits are currently reported in the wild, but the ease of exploitation and potential for arbitrary file overwrite make this a critical risk for systems relying on tar-fs for archive extraction.

Potential Impact

For European organizations, this vulnerability poses a significant risk especially for software development, deployment pipelines, and any systems that automatically extract tar archives using vulnerable tar-fs versions. Successful exploitation can lead to arbitrary file overwrite, potentially allowing attackers to modify configuration files, inject malicious code, or disrupt system operations. This can compromise system integrity and potentially lead to further compromise or data breaches. Organizations relying on Node.js environments or containerized applications that use tar-fs for package extraction or deployment are particularly at risk. The impact is heightened in sectors with critical infrastructure, financial services, and government agencies where integrity of systems is paramount. Additionally, supply chain attacks could leverage this vulnerability to propagate malicious payloads across multiple organizations. The lack of required privileges or user interaction means automated systems are vulnerable to remote exploitation if exposed to malicious tarballs.

Mitigation Recommendations

1. Immediately upgrade tar-fs to versions 3.0.9, 2.1.3, or 1.16.5 or later to apply the official patch addressing the path traversal issue. 2. If upgrading is not immediately feasible, configure the extraction process to use the 'ignore' option to skip non-file and non-directory entries, reducing the attack surface. 3. Implement strict validation and sanitization of all tarball inputs, especially those received from untrusted or external sources. 4. Employ runtime monitoring to detect unexpected file writes outside designated directories during extraction. 5. Use containerization or sandboxing to isolate extraction processes, limiting the impact of potential exploitation. 6. Review and restrict file system permissions to minimize the ability of the extraction process to overwrite critical files. 7. Incorporate integrity checks and digital signatures for tarballs to ensure authenticity before extraction. 8. Conduct security audits and penetration testing focused on archive extraction components in your software supply chain.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2025-05-19T15:46:00.397Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 683dfb4f182aa0cae252782f

Added to database: 6/2/2025, 7:28:15 PM

Last enriched: 8/22/2025, 12:53:33 AM

Last updated: 9/26/2025, 10:59:19 PM

Views: 21

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats