CVE-2026-31802: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in isaacs node-tar
node-tar is a full-featured Tar for Node.js. Prior to version 7.5.11, tar (npm) can be tricked into creating a symlink that points outside the extraction directory by using a drive-relative symlink target such as C:../../../target.txt, which enables file overwrite outside cwd during normal tar.x() extraction. This vulnerability is fixed in 7.5.11.
AI Analysis
Technical Summary
The vulnerability identified as CVE-2026-31802 in the isaacs node-tar package is a path traversal flaw classified under CWE-22. Node-tar is a widely used Node.js library for handling tar archives. Prior to version 7.5.11, node-tar improperly limits pathnames during extraction, specifically when processing symbolic links with drive-relative targets on Windows platforms. An attacker can craft a tar archive containing a symlink with a target path like C:../../../target.txt, which escapes the intended extraction directory. When such an archive is extracted using the vulnerable tar.x() method, files outside the current working directory can be overwritten, leading to arbitrary file overwrite. This vulnerability does not require authentication or user interaction and can be exploited locally or remotely if untrusted tar files are processed. The CVSS 4.0 score of 8.2 reflects high severity, with low attack complexity and no privileges required, but limited to local attack vector (AV:L). The flaw impacts confidentiality and integrity by allowing unauthorized modification of files, potentially enabling privilege escalation or code execution if critical system or application files are overwritten. The vulnerability is fixed in node-tar version 7.5.11 by properly sanitizing and restricting symlink targets to prevent directory traversal outside the extraction root.
Potential Impact
This vulnerability poses a significant risk to organizations using Node.js applications that rely on node-tar versions prior to 7.5.11, especially on Windows systems. Successful exploitation can lead to arbitrary file overwrites outside the extraction directory, compromising system integrity and potentially enabling further attacks such as privilege escalation, persistent malware installation, or disruption of application functionality. Confidential data could be overwritten or corrupted, and critical system files could be targeted, leading to denial of service or unauthorized control. Since node-tar is a common dependency in many Node.js projects, the attack surface is broad. Organizations that automatically extract tar archives from untrusted sources or user uploads are particularly at risk. Although no public exploits are currently known, the ease of exploitation and high impact make this a critical issue to address promptly to avoid potential widespread abuse.
Mitigation Recommendations
To mitigate this vulnerability, organizations should immediately upgrade all instances of node-tar to version 7.5.11 or later, where the path traversal issue is fixed. Review and restrict the sources of tar archives to trusted origins to reduce exposure to malicious files. Implement validation and sanitization of archive contents before extraction, especially checking for symlinks and their targets. Consider running extraction processes with least privilege, using sandboxed or containerized environments to limit the impact of potential exploitation. Monitor file system changes during extraction for unexpected modifications outside intended directories. For Windows environments, pay special attention to drive-relative symlink handling. Additionally, incorporate security scanning tools in the CI/CD pipeline to detect vulnerable node-tar versions and prevent deployment of affected code. Educate developers and DevOps teams about the risks of processing untrusted archives and enforce secure coding practices around file extraction.
Affected Countries
United States, Germany, United Kingdom, Canada, Australia, France, Japan, South Korea, India, Brazil
CVE-2026-31802: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in isaacs node-tar
Description
node-tar is a full-featured Tar for Node.js. Prior to version 7.5.11, tar (npm) can be tricked into creating a symlink that points outside the extraction directory by using a drive-relative symlink target such as C:../../../target.txt, which enables file overwrite outside cwd during normal tar.x() extraction. This vulnerability is fixed in 7.5.11.
AI-Powered Analysis
Technical Analysis
The vulnerability identified as CVE-2026-31802 in the isaacs node-tar package is a path traversal flaw classified under CWE-22. Node-tar is a widely used Node.js library for handling tar archives. Prior to version 7.5.11, node-tar improperly limits pathnames during extraction, specifically when processing symbolic links with drive-relative targets on Windows platforms. An attacker can craft a tar archive containing a symlink with a target path like C:../../../target.txt, which escapes the intended extraction directory. When such an archive is extracted using the vulnerable tar.x() method, files outside the current working directory can be overwritten, leading to arbitrary file overwrite. This vulnerability does not require authentication or user interaction and can be exploited locally or remotely if untrusted tar files are processed. The CVSS 4.0 score of 8.2 reflects high severity, with low attack complexity and no privileges required, but limited to local attack vector (AV:L). The flaw impacts confidentiality and integrity by allowing unauthorized modification of files, potentially enabling privilege escalation or code execution if critical system or application files are overwritten. The vulnerability is fixed in node-tar version 7.5.11 by properly sanitizing and restricting symlink targets to prevent directory traversal outside the extraction root.
Potential Impact
This vulnerability poses a significant risk to organizations using Node.js applications that rely on node-tar versions prior to 7.5.11, especially on Windows systems. Successful exploitation can lead to arbitrary file overwrites outside the extraction directory, compromising system integrity and potentially enabling further attacks such as privilege escalation, persistent malware installation, or disruption of application functionality. Confidential data could be overwritten or corrupted, and critical system files could be targeted, leading to denial of service or unauthorized control. Since node-tar is a common dependency in many Node.js projects, the attack surface is broad. Organizations that automatically extract tar archives from untrusted sources or user uploads are particularly at risk. Although no public exploits are currently known, the ease of exploitation and high impact make this a critical issue to address promptly to avoid potential widespread abuse.
Mitigation Recommendations
To mitigate this vulnerability, organizations should immediately upgrade all instances of node-tar to version 7.5.11 or later, where the path traversal issue is fixed. Review and restrict the sources of tar archives to trusted origins to reduce exposure to malicious files. Implement validation and sanitization of archive contents before extraction, especially checking for symlinks and their targets. Consider running extraction processes with least privilege, using sandboxed or containerized environments to limit the impact of potential exploitation. Monitor file system changes during extraction for unexpected modifications outside intended directories. For Windows environments, pay special attention to drive-relative symlink handling. Additionally, incorporate security scanning tools in the CI/CD pipeline to detect vulnerable node-tar versions and prevent deployment of affected code. Educate developers and DevOps teams about the risks of processing untrusted archives and enforce secure coding practices around file extraction.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-03-09T16:33:42.913Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 69af3955ea502d3aa8c59c83
Added to database: 3/9/2026, 9:19:17 PM
Last enriched: 3/9/2026, 9:33:54 PM
Last updated: 3/14/2026, 12:45:33 AM
Views: 22
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.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.