CVE-2026-140244: node-tar: Symlink containment bypass via nested symlink + '..' (lexical linkpath check)
node-tar checks that a symlink’s target stays inside cwd, but the check is lexical. It runs path.resolve(dirname, linkpath), which collapses .. without following symlinks. Entry 1 s1 -> . is accepted because its target is cwd. Entry 2 s2 -> s1/../secret.txt resolves lexically to <cwd>/secret.txt and is accepted too. On disk the kernel resolves s1 to cwd first and then applies .., so s2 points to <cwd>/../secret.txt, outside the extraction root. Repeating s1/ climbs further. node-tar rejects the direct form (../secret.txt gives TAR_ENTRY_ERROR), so it treats outside-pointing symlinks as in scope. This bypasses the linkpath containment added for GHSA-8qq5-rm4j-mr97 and related advisories.
References
Code Behaviors & Features
Detect and mitigate CVE-2026-140244 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →