All vulnerabilities

npm

CVE-2026-140238

node-tar: Newline injection in PAX extended-header records enables entry-attribute forgery (path overwrite → npm postinstall RCE on Windows)

Severity
High
Published
2 Dec 2026
Last changed
2 Dec 2026
Added to UpHeron
2 Dec 2026
Fixed in
8.0.0
Weakness
Path traversal (CWE-22)CRLF injection (CWE-93)
Also known as
GHSA-mpg7-vg3p-wc3m
Sources
OSV.dev and GitHub

Description

node-tar's PAX extended-header record framing is not enforced by byte length, so a newline embedded in any PAX value is reinterpreted on extraction as a record boundary. This lets an attacker forge arbitrary PAX records (path, linkpath, size, uid, ...) for an entry, overriding its real header-derived attributes. In the most damaging case this rewrites an entry's path, writing content to a location the archive's structure did not declare.

This is distinct from the already-published PAX issues: GHSA-gvwx-54wh-qm9j is NUL-byte-in-PAX causing a DoS crash; this report is newline-in-PAX causing silent record forgery / attribute override — an integrity/path-overwrite primitive, not a crash. Verified end-to-end: overwriting package.json inside an installed npm package and executing an injected postinstall on a real Windows machine.

Extraction side — src/pax.ts parseKV (primary): the PAX body is split on \n and each line is validated only by a per-line self-consistency check (declaredLen…

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
tarnpm · osv:npm:tar
  • Every version before 8.0.0

About tar

Weekly downloads (npm)
113,520,680npm, 1 Dec 2026

References