HIGHCVSS v4 7.1Vulnerability

CVE-2026-140242

## Summary `tar` (node-tar) does not validate that a numeric `size` value supplied through a PAX extended header (typeflag `x`) is finite before it is applied to the following archive entry. A PAX record such as `17 size=Infinity\n` is coerced to the JavaScript number `Infinity` and accepted, because the only guard on the value is a `>= 0` check and `Infinity >= 0` is true. The non-finite size then propagates into the entry-body state machine and, when the entry is re-packed, into numeric header encoding. Any process that parses, extracts, lists, or re-packs an attacker-supplied archive is affected; no authentication or non-default configuration is required. ## Root Cause The PAX key/value parser assigns the `size` field after a check that was designed only to reject negative values. It never checks that the coerced number is finite or a safe integer, so `Infinity` (and other non-finite positive values) pass. ```typescript // src/pax.ts (parseKVLine) case 'size': const s = +v // +"Infinity" === Infinity if (s >= 0) set[k] = s // Infinity >= 0 is true, so size is set to Infinity break ``` The `>= 0` guard was added to reject negative sizes. It does not enforce finiteness. The secondary guard `notNegative()` in `src/header.ts` has the same gap: `Infinity < 0` is false, so it returns `Infinity` unchanged. As a result the entry's `size` becomes `Infinity` and reaches two distinct sinks: the parser body-length state machine and the numeric header encoder used during re-packing. ## Impact An unauthenticated remote attacker who can supply a tar archive to a consumer of this library obtains two demonstrated denial-of-service primitives, both from a single crafted archive with no user interaction: - Extraction / listing entry loss: when the Infinity-sized entry is parsed, the body-length counter becomes `Infinity`, the parser never transitions out of the body-consumption state, and every subsequent entry in the archive is silently consumed as body d

Properties

Severity
high
Summary
node-tar: Non-finite PAX size (Infinity) bypasses validation, causing extraction entry loss and an uncaught exception when re-packing
Nvd fetched at
2026-12-02T06:37:54.190518+00:00
Cvss severity
HIGH
Cvss score
7.1
Retrieved at
2026-12-02T06:39:20+00:00
Ghsa published
2026-12-02T01:14:32Z
Source url
https://github.com/advisories/GHSA-ph3c-p786-j4rp
Ghsa updated
2026-12-02T01:14:33Z
Ghsa id
GHSA-ph3c-p786-j4rp
Last source
GitHub Advisory Database
Score
7.1
Cvss version
4.0
Cve id
CVE-2026-140242
Cvss vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
First seen by Signal
2026-12-01T18:35:21+00:00
Name
CVE-2026-140242
Is ghsa only
false
Vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Published at
2026-12-01T18:17:28.307

Related Entities (3)

AFFECTS (1)

→[Software]npm/tar

VULNERABLE_TO (1)

←[Software]npm/tar

Related research

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-140242 (CVSS v4 7.1) — Ninja Signal Threat Intelligence | Ninja Signal