Executive summary
CVE-2026-140250 affects the node-tar archive library for Node.js. In versions 7.5.5 through 7.5.22, tar.x incorrectly validates symbolic-link targets when an archive contains chained symlinks. This mismatch allows a crafted archive to create a symbolic link whose resolved destination lies outside the intended extraction directory.
The vulnerable behavior is associated with CWE-22, improper limitation of a pathname to a restricted directory, and CWE-59, improper link resolution before file access. The supplied intelligence classifies the issue as HIGH with a CVSS 4.0 score of 7.2, although the individual vector metrics are redacted.
The flaw was fixed in node-tar 8.0.0. Public proof-of-concept material is cited, but the supplied sources contain no evidence of a named incident or confirmed exploitation against production systems. The CVE is also not identified as being on the CISA KEV catalog in the provided risk assessment.
Technical details
The defect exists in the symbolic-link validation logic in src/unpack.ts. The described attack uses two linked archive entries: an intermediate symlink named sub/up points to .., while a second symlink named esc points to sub/up/../outside.txt.
During validation, vulnerable node-tar versions normalized the .. component lexically without first recognizing that sub/up was itself a symbolic link. The validator could therefore accept a target that appeared to remain under the extraction directory. At the operating-system level, however, sub/up resolves first and the subsequent .. component is then interpreted relative to that resolved location. The final symlink can therefore point outside the extraction root.
This behavior breaks the expected containment guarantee for extraction. The immediate effect is creation of an unsafe symbolic link. File disclosure or modification occurs when the application subsequently opens, reads, writes, copies, or otherwise follows that link, using the privileges of the extracting process.
The fixed implementation changes validation so that .. is accepted only at the beginning of a symbolic-link target rather than after another path portion. The cited fix is included in node-tar 8.0.0 through commit 23b368128b6cf7d4c26f2e302c0e4a82f70a6e3d.
Affected systems
- Product:
node-tar
- Affected versions: 7.5.5 through 7.5.22
- Equivalent affected range:
>= 7.5.5, < 8.0.0
- Fixed version: 8.0.0
- Affected component: symbolic-link validation in
src/unpack.ts
- Affected operation:
tar.xextraction with the vulnerable default behavior described in the exploit material
Applications are potentially exposed when they use an affected node-tar release, accept attacker-influenced tar archives, and later follow extracted symlinks. Relevant scenarios include upload handlers, package and artifact extraction, build systems, CI workflows, and other services that process untrusted archives. Applications that never dereference extracted symlinks have a narrower immediate risk, although they still violate the expected extraction boundary.
Attack requirements and impact
Practical exploitation requires an affected dependency, control over the archive contents, the chained-symlink traversal structure, and a later operation that follows the resulting link. The process must also have permission to access the affected external path.
The vulnerability can be reached through a network-facing archive-submission workflow, but this does not mean that every deployment using node-tar is directly network exposed. Consequences depend on the extracting application's filesystem permissions and subsequent behavior. A privileged extraction service could expose sensitive files or permit modification of files outside its intended working directory. Services with limited permissions may reduce the practical impact, while privileged CI or build workers could increase it.
Public exploit listings demonstrate that the technique is technically reproducible. They do not, however, show that attackers have used it against real systems.
Mitigation
Upgrade node-tar to version 8.0.0 or later. Confirm the version actually loaded at runtime by checking lockfiles, dependency trees, and SBOMs, including transitive installations and maintained forks. A direct dependency update alone may not be sufficient if an older release remains reachable elsewhere in the dependency graph.
Where an immediate upgrade is not possible:
- Avoid extracting untrusted archives with affected versions.
- Reject symbolic links and hard links when the workflow does not require them.
- Independently reject chained symbolic links and symbolic-link targets containing
..after the initial path portion.
- Prevent later processing from dereferencing extracted links, and verify that canonical destinations remain beneath the canonical extraction root before reads or writes.
- Run extraction with minimal filesystem privileges inside an isolated worker, container, or sandbox without sensitive mounts.
- Treat the extraction directory as untrusted until archive validation and post-extraction link checks are complete.
Detection and response
Inventory JavaScript and TypeScript applications for node-tar versions in the affected range. Review application and CI logs for extraction warnings involving TARENTRY_ERROR, symbolic links, path traversal, or attempts to access paths outside the extraction root.
After extraction, enumerate symlinks and canonicalize their targets. Pay particular attention to links containing parent-directory components or references to other extracted symlinks. Filesystem and process telemetry can also help identify extraction workers accessing locations outside their designated working directories.
If untrusted archives were processed by a privileged application, reviewing access to sensitive files and rotating exposed credentials may be warranted. A malicious link can be followed without producing an obvious extraction error.
Expert insight
The important issue is not simply that an archive contains .., but that validation and operating-system link resolution use different interpretations of the same path. Lexical normalization can appear safe while an intermediate symlink changes where a later path component is resolved. Security checks therefore need to account for the complete link chain rather than validating only the final textual target.
This vulnerability also illustrates why extraction should be treated as a security boundary. Even when direct extraction does not overwrite a file, an attacker-created link can transfer risk to a later consumer that trusts the extracted directory. Version inspection, canonical-path enforcement, and filesystem isolation remain valuable complementary controls, but upgrading to node-tar 8.0.0 is the direct remedy for the library defect.
References
- nvd.nist.gov/vuln/detail/CVE-2026-140250
- cvefeed.io/vuln/detail/CVE-2026-140250
- vulners.com/nvd/NVD:CVE-2026-140250?utm_source…m_campaign=rss
- github.com/isaacs/node-tar/commit/23b368128b6c…0e4a82f70a6e3d
- github.com/isaacs/node-tar/releases/tag/v8.0.0
- github.com/isaacs/node-tar/security/advisories…3wwj-8j6r-q339