CVE-2026-140244: node-tar: symlink containment bypass via nested symlink + '..' (lexical linkpath check)
node-tar is a tar archive manipulation library for Node.js. Prior to 8.0.0, the STRIPABSOLUTEPATH linkpath containment check uses path.resolve and collapses parent components without following an earlier archive-created symlink. A second symlink can therefore be planted inside the extraction root while pointing outside it. A later consumer that reads, serves, copies, or archives the extracted tree can follow the link and read an arbitrary file. Hardlinks and subsequent node-tar writes through the planted link remain blocked. This issue is fixed in version 8.0.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
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 provide or influence a tar archive that node-tar extracts. The archive must create nested symlinks that bypass the lexical containment check, and a later consumer must follow the planted symlink by reading, serving, copying, or archiving the extracted tree.
What is the practical impact of a planted symlink?
A later consumer of the extracted tree can follow the symlink and read an arbitrary file outside the extraction root. The issue does not permit hardlink exploitation or subsequent node-tar writes through the planted link, as those remain blocked.
Which versions are affected and what fixes the issue?
Versions prior to 8.0.0 are affected. Upgrade node-tar to version 8.0.0 to obtain the fix.