Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. tar
  4. ›
  5. CVE-2026-140244

CVE-2026-140244: node-tar: Symlink containment bypass via nested symlink + '..' (lexical linkpath check)

December 2, 2026

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

  • github.com/advisories/GHSA-mhqm-9wj8-w7r4
  • github.com/isaacs/node-tar/commit/23b368128b6cf7d4c26f2e302c0e4a82f70a6e3d
  • github.com/isaacs/node-tar/releases/tag/v8.0.0
  • github.com/isaacs/node-tar/security/advisories/GHSA-mhqm-9wj8-w7r4
  • nvd.nist.gov/vuln/detail/CVE-2026-140244

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 →

Affected versions

All versions before 8.0.0

Fixed versions

  • 8.0.0

Solution

Upgrade to version 8.0.0 or above.

Impact 7.6 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:L

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
  • CWE-59: Improper Link Resolution Before File Access ('Link Following')

Source file

npm/tar/CVE-2026-140244.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 02 Dec 2026 12:16:02 +0000.