All vulnerabilities

npm

CVE-2026-140237

node-tar: ReadEntry pending PAX size reapplication permits metadata-body file smuggling

Severity
Medium
Published
2 Dec 2026
Last changed
2 Dec 2026
Added to UpHeron
2 Dec 2026
Fixed in
8.0.0
Weakness
CWE-436
Also known as
GHSA-p96f-8xj2-g85p
Sources
OSV.dev and GitHub

Description

A crafted tar archive containing consecutive PAX headers can make node-tar interpret a block inside a PAX metadata body as a real filesystem entry. Under default options, both tar.list() and tar.extract() expose the hidden entry, and extraction can truncate an existing file inside the destination directory.

The issue remains in [email protected] and current commit 2a22bfc5d3a432a606d9da0e2d87ba634aa3b1cb. It is a residual path around the PAX intermediary-entry fix released in 7.5.16.

The archive uses this sequence:

Header.decode() now checks the raw type flag and correctly refuses to apply pending PAX fields to the second PAX header. Its decoded size is therefore the physical value 512.

However, ReadEntry size initializes its body counters from that correct header, then ReadEntry.#slurp() copies the pending PAX object onto the entry without an entry-type guard.

The second PAX entry consequently has inconsistent state:

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

Affected software

SoftwareAffected versions
tarnpm · osv:npm:tar
  • From 7.0.0 before 8.0.0

About tar

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

References