node-tar 8.0.0 Patch Resolves High-Severity PAX Header Injection Flaw

3 min read
Source: CVEs | Zero Wire | Cloudflare Radar
node-tar 8.0.0 Patch Resolves High-Severity PAX Header Injection Flaw
Photo: CVEs | Zero Wire | Cloudflare Radar
TL;DR

A high-severity vulnerability in the node-tar library, identified as CVE-2026-140239, has been patched in version 8.0.0. The flaw allowed attackers to inject malicious linkpath values via global PAX extended headers, bypassing strict-mode validation and enabling arbitrary file read or write operations. The issue affected versions prior to 8.0.0 and was fixed with a major release that also introduced breaking API changes.

Key points

  • CVE-2026-140239 was assigned by GitHub, Inc. and published on December 1, 2026, with a CVSS 4.0 score of 7.2 (High).
  • The vulnerability exists in node-tar versions prior to 8.0.0, where a PAX Global Extended Header containing a linkpath could populate entry.linkpath on every entry returned by tar.Parser without triggering a strict-mode warning.
  • Attackers could exploit this to create paths or symlinks outside intended directories, resulting in arbitrary file read or write operations, though tar.x and tar.extract operations were not affected due to separate validation.
  • The fix was released in version 8.0.0, which also included breaking changes such as dropping support for Node.js versions below 22 and replacing callbacks and streams with promises.
  • The vulnerability is classified as Improper Input Validation (CWE-20) and Insufficient Verification of Data Authenticity (CWE-345), with a high likelihood of exploitation.

Background

This is the third high-severity vulnerability in node-tar to be patched in version 8.0.0, following CVE-2026-140119 (heap exhaustion) and a denial-of-service flaw in async extraction. The 8.0.0 release was a major version bump that introduced significant API changes, including the removal of callbacks and Node.js streams in favor of promises, and made Parser, Pack, and Unpack non-stream objects. Subsequent patch releases (8.0.1 through 8.0.4) were issued on November 28 and 30, 2026, to address additional issues related to parent directory checks, memory limits, and parser behavior.

Why it matters

The vulnerability allows attackers to bypass strict-mode validation and inject attacker-controlled linkpath values, potentially leading to arbitrary file read or write operations. This could result in data exfiltration, system compromise, or unauthorized access to sensitive files, especially in applications that use tar.Parser or tar.list() directly and trust entry.linkpath to build paths or create symlinks.

What to watch

Developers should upgrade to node-tar version 8.0.4 or later to ensure all known vulnerabilities are patched. The 8.0.0 release introduced breaking changes, so applications may need to be updated to accommodate the new API, including the removal of callbacks and Node.js streams in favor of promises. Additionally, subsequent patch releases (8.0.1 through 8.0.4) addressed additional issues, so users should ensure they are on the latest version to benefit from all fixes.

Share this article

Want the full story? Read the original reporting

Read on CVEs | Zero Wire | Cloudflare Radar