CVE-2026-140247: node-tar: Symlink linkpath escape check is lexical: '..' after an in-archive symlink creates symlinks outside the extraction directory
node-tar is a tar archive manipulation library for Node.js. Prior to 8.0.0, a crafted archive can create a SymbolicLink inside the extraction directory whose linkpath contains a previously created symlink component followed by a parent traversal. STRIPABSOLUTEPATH evaluates the target lexically, but the filesystem follows the earlier symlink first, so the planted link target resolves outside the extraction root. A later consumer that follows the link can read or write outside that root. This issue is fixed in version 8.0.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/node-tarto a version that resolves this vulnerability.Fixed in 8.0.0
Event History
Frequently Asked Questions
What conditions are required for exploitation?
An attacker must be able to supply a crafted tar archive that the application extracts with a vulnerable node-tar version. The archive must create an in-archive symlink and then use that symlink as a component of a later symbolic-link target followed by parent traversal.
Does extracting the archive alone cause an out-of-root read or write?
The crafted archive plants a symlink whose target resolves outside the extraction root. A later consumer must follow that link for an out-of-root read or write to occur.
Which versions are affected and what is the remediation?
node-tar versions prior to 8.0.0 are affected. Upgrade to version 8.0.0.