Visit the Wiz Whimzical Shop at AWS re:Invent
Vulnerability DatabaseCVE-2026-140245

CVE-2026-140245: 
JavaScript vulnerability analysis and mitigation

Overview

CVE-2026-140245 is a symlink linkpath containment bypass vulnerability in the node-tar npm package (published as tar on npm) affecting versions >= 7.5.5 and < 8.0.0. A crafted tar archive containing an entry path ending in /. can create a symbolic link pointing outside the intended extraction directory, bypassing containment checks silently with default options and no warning. The vulnerability was disclosed on November 28, 2026, and fixed in version 8.0.0. It carries a CVSS v4.0 base score of 7.2 (High) (GitHub Advisory, Feedly).

Technical details

The root cause is a path traversal flaw (CWE-22) introduced by the #450 relative-linkpath fix in node-tar 7.5.5. The STRIPABSOLUTEPATH logic validates a relative symlink's linkpath against path.posix.dirname(entry.path), but the symlink is physically created at path.resolve(cwd, entry.path). When an entry path ends in /. (e.g., x/.), dirname returns a base one level shallower than the actual filesystem location of the link, causing the containment check to normalize x/../outside/secret.txt to outside/secret.txt — which passes the startsWith('../') guard — while the kernel resolves the link from cwd and lands outside the extraction directory. The fix in 8.0.0 normalizes entry.path before computing entryDir (using path.posix.normalize) and additionally rejects any .. segment appearing after a named path component (GitHub Advisory, Fix Commit).

Impact

A crafted archive can place a symlink outside the extraction directory without triggering any warning under default options. While node-tar itself does not follow the rogue symlink for subsequent writes (using O_NOFOLLOW and refusing symlink parents for mkdir), any consuming application that later writes through the extracted path will write to an unintended location outside the destination directory. This enables integrity compromise of arbitrary files writable by the process, with limited confidentiality impact (e.g., reading file existence via symlink resolution) and low availability impact, consistent with the CVSS v4.0 scoring (GitHub Advisory).

Exploitability

A proof-of-concept was included in the security advisory, demonstrating exploitation against the npm-published tar@7.5.22 with a single archive entry and default options. The PoC archive entry { path: 'x/.', type: 'SymbolicLink', linkpath: '../outside/secret.txt' } successfully creates an escaped symlink with no warnings. No in-the-wild exploitation has been reported, and the EPSS score is 0.0. The CVE status is listed as "Deferred" and it is not currently in the CISA KEV catalog (GitHub Advisory, Feedly).

Exploitation steps

  1. Craft a malicious archive: Create a tar archive with a single SymbolicLink entry where path ends in /. (e.g., x/.) and linkpath points outside the extraction directory (e.g., ../outside/secret.txt).
  2. Deliver the archive: Provide the crafted archive to a target application that uses node-tar (npm package tar) versions 7.5.5–7.5.22 for extraction — for example, via file upload, package distribution, or a supply-chain vector.
  3. Trigger extraction: The target application extracts the archive using default options (no custom onwarn handler, no strict mode). The containment check passes because path.posix.dirname('x/.') returns x instead of the actual creation directory, allowing ../outside/secret.txt to pass the startsWith('../') guard.
  4. Symlink is created outside the destination: The symlink x (resolved from x/.) is created in the extraction directory pointing to ../outside/secret.txt, with no warning emitted.
  5. Exploit consumer writes: If the consuming application subsequently writes data through the extracted path (e.g., post-processing extracted files), the write is redirected to the attacker-controlled symlink target outside the extraction directory, potentially overwriting sensitive files (GitHub Advisory).

Indicators of compromise

  • File System: Unexpected symbolic links in the extraction directory whose targets resolve to paths outside the extraction root; symlinks with names that are plain directory names (e.g., x) pointing to ../ paths.
  • File System: Presence of archive entries with paths ending in /. or /./ (e.g., x/., esc/./) in tar files processed by the application.
  • Logs: Application-level warnings or errors referencing TAR_ENTRY_ERROR with message linkpath escapes extraction directory (patched versions) — absence of such warnings on vulnerable versions despite suspicious archives is itself an indicator.
  • Process: Unexpected file modifications outside the designated extraction directory following a tar extraction operation, particularly in directories writable by the Node.js process (GitHub Advisory).

Mitigation and workarounds

Upgrade the tar npm package to version 8.0.0 or later, which normalizes entry.path before computing the symlink containment base directory and rejects .. segments appearing after any named path component (node-tar v8.0.0 Release, Fix Commit). Note that v8.0.0 is a major release with breaking API changes (removal of callbacks, Node.js streams, sync option renamed, Node < 22 dropped), so review the migration guide before upgrading. No configuration-based workaround is available for the vulnerable versions; the only mitigation short of upgrading is to avoid extracting untrusted archives with affected versions.

Community reactions

The vulnerability was reported to the node-tar maintainers with AI assistance by researcher Figo5 and published as a GitHub Security Advisory (GHSA-jmj2-9c5q-vw73) on November 28, 2026. The advisory notes it is distinct from the previously accepted GHSA-9ppj-qmqm-q256 (CVE-2026-31802), which involved a malicious linkpath string, whereas this issue stems from a defect in entry-path base computation introduced by the #450 fix. No significant broader media coverage or social media discussion beyond standard CVE aggregator activity has been observed (GitHub Advisory).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

RHEL / CentOS

Affected

OpenShift

openshift4/ose-console

Affected

RHEL 8

Not Affected

RHEL 9

Not Affected

RHEL 10

Not Affected

Source: This report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-7cfw-w2rf-f3jcMEDIUM5.3
  • JavaScript logoJavaScript
  • fast-xml-parser
NoYesDec 01, 2026
CVE-2026-141514LOW3.7
  • JavaScript logoJavaScript
  • minimatch
NoYesDec 01, 2026
GHSA-844h-fxvq-x544LOWN/A
  • JavaScript logoJavaScript
  • tar
NoYesDec 02, 2026
GHSA-8282-h5g3-523jLOWN/A
  • JavaScript logoJavaScript
  • tar
NoYesDec 02, 2026
GHSA-p4w4-63wp-74wqLOWN/A
  • JavaScript logoJavaScript
  • tar
NoYesDec 02, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management