CVE-2026-140238: PAX Extended Header Newline Injection and File Overwrite in node-tar
Vulnerability ID: CVE-2026-140238
CVSS Score: 7.2
Published: 2026-12-02
CVE-2026-140238 (GHSA-mpg7-vg3p-wc3m) is a high-severity parsing vulnerability in node-tar versions prior to 8.0.0. By splitting POSIX.1-2001 PAX extended header blocks on raw newline characters instead of enforcing byte-length framing prefixes, the parser allows unescaped newlines within metadata fields to inject forged PAX records. Attackers can override entry attributes such as file paths during extraction, enabling arbitrary file overwrites inside the destination directory and remote code execution on Windows via npm lifecycle script injection.
TL;DR
An improper record framing flaw in node-tar (< 8.0.0) allows newline characters inside PAX extended header values to inject arbitrary metadata attributes like 'path'.…