node-tarの脆弱性、不正なPAXサイズで展開時にエントリが失われる
Summary
node-tarの7.0.0から7.5.24より前の版には、PAXヘッダーのサイズに無限大(Infinity)を指定すると検証を素通りする脆弱性があります。展開でファイルが欠落するほか、再パッキング時に例外で処理が止まるおそれがあります。修正版の7.5.24への更新をおすすめします。
AI summary
Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.
node-tarの7.0.0から7.5.24より前の版には、PAXヘッダーのサイズに無限大(Infinity)を指定すると検証を素通りする脆弱性があります。展開でファイルが欠落するほか、再パッキング時に例外で処理が止まるおそれがあります。修正版の7.5.24への更新をおすすめします。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| isaacsnode-tar | — | Not listed |
| npmtar |
≥ 7.0.0, < 7.5.24→ 7.5.24 |
7.5.24 |
Fix status by distribution
Records published by each distribution for this CVE. Fixed versions differ by release; check each link.
- Debian DEBIAN-CVE-2026-140242 node-tar No fixed version in this record
Original description The description as published by the source.
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.
// 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 use…
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
References
- advisory github.com
- advisory nvd.nist.gov
- package github.com
- web github.com
- web github.com
- web github.com
- web github.com