CVE-2025-48387: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in mafintosh tar-fs
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 Analysis
Technical Summary
CVE-2025-48387 is a path traversal vulnerability classified under CWE-22 affecting the mafintosh tar-fs library, which is widely used to provide filesystem bindings for tar-stream in Node.js environments. The vulnerability exists in versions prior to 3.0.9, 2.1.3, and 1.16.5, where the extraction logic fails to properly restrict pathname resolution within a designated directory. An attacker can craft a malicious tarball containing file paths with directory traversal sequences (e.g., '../') that cause files to be written outside the intended extraction directory. This can lead to overwriting critical system or application files, potentially resulting in arbitrary code execution, privilege escalation, or denial of service. The vulnerability does not require any privileges or user interaction, making it remotely exploitable by anyone able to supply a tarball to an affected system. The issue has been addressed in the specified patched versions by enforcing stricter path validation during extraction. As a temporary workaround, users can configure the ignore option to skip non-file and non-directory entries, reducing the attack surface. No known exploits are currently reported in the wild, but the high CVSS score (8.7) reflects the significant risk posed by this vulnerability due to its impact and ease of exploitation.
Potential Impact
For European organizations, this vulnerability poses a significant risk especially for those relying on Node.js applications or development tools that incorporate the tar-fs library for handling tar archives. Exploitation can lead to unauthorized file writes outside intended directories, potentially overwriting configuration files, binaries, or sensitive data, which may result in system compromise, data corruption, or service disruption. This is particularly critical for organizations with automated deployment pipelines, container build processes, or software distribution mechanisms that process tarballs. The confidentiality, integrity, and availability of systems can be severely impacted without requiring authentication or user interaction. Given the widespread use of open-source Node.js components in European tech sectors, including finance, manufacturing, and government, the vulnerability could facilitate supply chain attacks or lateral movement within networks. The lack of known exploits in the wild suggests proactive patching can prevent exploitation, but delayed remediation increases risk exposure.
Mitigation Recommendations
1. Immediately upgrade all instances of mafintosh tar-fs to versions 3.0.9, 2.1.3, or 1.16.5 or later, depending on the version branch in use. 2. Audit all software dependencies and build pipelines to identify usage of vulnerable tar-fs versions, including transitive dependencies in Node.js projects. 3. Implement strict validation and sanitization of all tarball inputs, especially those originating from untrusted or external sources. 4. Use the ignore option to skip non-file and non-directory entries as a temporary workaround if immediate upgrading is not feasible. 5. Monitor file system changes and logs for unusual write activities outside expected directories during tar extraction processes. 6. Employ application whitelisting and integrity monitoring to detect and prevent unauthorized file modifications. 7. Educate developers and DevOps teams about the risks of path traversal in archive extraction and enforce secure coding practices. 8. Consider isolating extraction processes in sandboxed or containerized environments to limit potential damage from exploitation.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Ireland
CVE-2025-48387: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in mafintosh 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
Technical Analysis
CVE-2025-48387 is a path traversal vulnerability classified under CWE-22 affecting the mafintosh tar-fs library, which is widely used to provide filesystem bindings for tar-stream in Node.js environments. The vulnerability exists in versions prior to 3.0.9, 2.1.3, and 1.16.5, where the extraction logic fails to properly restrict pathname resolution within a designated directory. An attacker can craft a malicious tarball containing file paths with directory traversal sequences (e.g., '../') that cause files to be written outside the intended extraction directory. This can lead to overwriting critical system or application files, potentially resulting in arbitrary code execution, privilege escalation, or denial of service. The vulnerability does not require any privileges or user interaction, making it remotely exploitable by anyone able to supply a tarball to an affected system. The issue has been addressed in the specified patched versions by enforcing stricter path validation during extraction. As a temporary workaround, users can configure the ignore option to skip non-file and non-directory entries, reducing the attack surface. No known exploits are currently reported in the wild, but the high CVSS score (8.7) reflects the significant risk posed by this vulnerability due to its impact and ease of exploitation.
Potential Impact
For European organizations, this vulnerability poses a significant risk especially for those relying on Node.js applications or development tools that incorporate the tar-fs library for handling tar archives. Exploitation can lead to unauthorized file writes outside intended directories, potentially overwriting configuration files, binaries, or sensitive data, which may result in system compromise, data corruption, or service disruption. This is particularly critical for organizations with automated deployment pipelines, container build processes, or software distribution mechanisms that process tarballs. The confidentiality, integrity, and availability of systems can be severely impacted without requiring authentication or user interaction. Given the widespread use of open-source Node.js components in European tech sectors, including finance, manufacturing, and government, the vulnerability could facilitate supply chain attacks or lateral movement within networks. The lack of known exploits in the wild suggests proactive patching can prevent exploitation, but delayed remediation increases risk exposure.
Mitigation Recommendations
1. Immediately upgrade all instances of mafintosh tar-fs to versions 3.0.9, 2.1.3, or 1.16.5 or later, depending on the version branch in use. 2. Audit all software dependencies and build pipelines to identify usage of vulnerable tar-fs versions, including transitive dependencies in Node.js projects. 3. Implement strict validation and sanitization of all tarball inputs, especially those originating from untrusted or external sources. 4. Use the ignore option to skip non-file and non-directory entries as a temporary workaround if immediate upgrading is not feasible. 5. Monitor file system changes and logs for unusual write activities outside expected directories during tar extraction processes. 6. Employ application whitelisting and integrity monitoring to detect and prevent unauthorized file modifications. 7. Educate developers and DevOps teams about the risks of path traversal in archive extraction and enforce secure coding practices. 8. Consider isolating extraction processes in sandboxed or containerized environments to limit potential damage from exploitation.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
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: 11/4/2025, 1:29:02 AM
Last updated: 11/22/2025, 2:31:16 PM
Views: 31
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2024-0401: CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in ASUS ExpertWiFi
HighCVE-2024-23690: CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in Netgear FVS336Gv3
HighCVE-2024-13976: CWE-427 Uncontrolled Search Path Element in Commvault Commvault for Windows
HighCVE-2024-12856: CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in Four-Faith F3x24
HighCVE-2025-13526: CWE-200 Exposure of Sensitive Information to an Unauthorized Actor in walterpinem OneClick Chat to Order
HighActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.