CVE-2026-140239: node-tar: Global PAX extended header injects attacker-controlled linkpath into tar.Parser entries, bypassing strict-mode validation
node-tar is a tar archive manipulation library for Node.js. Prior to 8.0.0, a PAX Global Extended Header containing linkpath can populate entry.linkpath on every entry returned by tar.Parser without a strict-mode warning. Direct tar.Parser or tar.list consumers that trust this value can create paths or symlinks outside their intended directory, resulting in arbitrary file read or write. Node-tar's own tar.x and tar.extract operations are not affected because Unpack separately rejects an escaping linkpath. 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
Which uses of node-tar are affected?
Applications using tar.Parser directly or tar.list and then trusting entry.linkpath are affected. node-tar's own tar.x and tar.extract operations are not affected because Unpack independently rejects an escaping linkpath.
What must an attacker provide to exploit this issue?
An attacker needs to supply a tar archive containing a PAX Global Extended Header with a linkpath value. That value can then populate entry.linkpath for every entry returned by tar.Parser without a strict-mode warning.
Does enabling strict mode prevent the issue?
No. The malicious global linkpath is applied without a strict-mode warning, so consumers cannot rely on strict-mode validation to identify it.
What is the remediation?
Upgrade node-tar to version 8.0.0. If upgrading is not immediately possible, avoid trusting entry.linkpath from tar.Parser or tar.list when processing untrusted archives, and reject link paths that escape the intended directory.