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

CVE-2026-140247: node-tar: Symlink linkpath escape check is lexical: '..' after an in-archive symlink creates symlinks outside the extraction directory

December 2, 2026

With default options, tar.x() / Unpack / UnpackSync can be made to create SymbolicLink entries whose targets resolve outside the extraction directory, although the README states that “Link and SymbolicLink entries are not allowed to target locations outside of the extraction folder”. The trick is a .. segment that follows a symlink created earlier by the same archive:

l1 SymbolicLink -> . esc SymbolicLink -> l1/../outside.txt (lexically “outside.txt”, actually /../outside.txt) escdir SymbolicLink -> l1/.. (lexically “.”, actually the parent of cwd)

or, to go further up (one level per in-archive directory):

p/q/r/s SymbolicLink -> ../../.. (= cwd) x SymbolicLink -> p/q/r/s/../../../victim.txt (lexically “p/victim.txt”, actually /../../../victim.txt)

None of these entries produces a warning, while the direct form (esc -> ../outside.txt) is still rejected. The step-2 symlink of the GHSA-83g3-92jg-28cx chain (a/b/c/up -> ../.., a/b/escape -> c/up/../..) also still points outside the extraction root on 7.5.23; that fix blocked only the step-3 hardlink.

References

  • github.com/advisories/GHSA-gvrf-jx37-rjv5
  • 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-gvrf-jx37-rjv5
  • nvd.nist.gov/vuln/detail/CVE-2026-140247

Code Behaviors & Features

Detect and mitigate CVE-2026-140247 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-140247.yml

Spotted a mistake? Edit the file on GitLab.

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

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