CVE-2026-140249: node-tar: Symlink target escapes the extraction directory through an in-archive symlink chain
node-tar is a tar archive manipulation library for Node.js. From 7.5.5 until 8.0.0, symlink target escapes the extraction directory through an in-archive symlink chain. An attacker who supplies a tarball can make tar.x() with default options leave symlinks inside the extraction directory that point to any path on the system. tar itself does not write through them, but any later read or write of the extracted files by the application follows them: the demonstration overwrites a file outside the extraction directory and resolves a link to /etc/hostname. This gives arbitrary file read and write as the extracting user. This issue is fixed in version 8.0.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 8.0.0
Event History
Frequently Asked Questions
Are default extraction settings affected?
Yes. An attacker-supplied tarball can cause tar.x() with default options to leave symlinks in the extraction directory that point to arbitrary system paths.
What must happen for this to result in file access outside the extraction directory?
The application must later read from or write to an extracted path that traverses one of the malicious symlinks. tar itself does not write through the symlinks during extraction, but subsequent application operations follow them.
Who is exposed and what is the impact?
Applications that extract tarballs supplied by an attacker using affected node-tar versions are exposed. The attacker can obtain arbitrary file read and write access with the permissions of the user performing extraction.
Which versions are affected, and what version fixes the issue?
Versions from 7.5.5 until 8.0.0 are affected. The issue is fixed in version 8.0.0.