CVE-2026-140236: node-tar Archive Framing Differential From PAX Vulnerability

HIGH
Advisory Identifier: GHSA-qv2w-fc3h-pm27
CWE-436
Published
Advisory Summary

CVE-2026-140236 is a HIGH archive framing differential from pax vulnerability (CWE-436: Interpretation Conflict) affecting node-tar libraries in the npm ecosystem. The issue involves archive framing differential from pax size still being applied to gnu/pax meta entries via readentry and related size/precedence inconsistencies. Remediation is available by upgrading affected packages to version 8.0.0.

CVE-2026-140236 at a Glance

CVE Identifier CVE-2026-140236
GHSA Identifier GHSA-qv2w-fc3h-pm27
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-436: Interpretation Conflict
Affected Product node-tar
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-140236

To remediate this vulnerability, upgrade all affected node-tar dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

tar fixed: 8.0.0
npm install tar@8.0.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls tar

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-140236, inspect your project dependencies using npm:

npm ls tar

Analyze the terminal output to locate any version of node-tar in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.0.0), your application is affected.

Note: The npm ls tar command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-436: Interpretation Conflict, where product a handles inputs or steps differently than product b, which causes a to perform incorrect actions based on its perception of b's state. In node-tar, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary The GHSA-vmf3 fix (7.5.16, commit 21a8220) stopped `Header.decode` from applying extended-header values to non-file blocks. `ReadEntry`, however, still copies the PAX `size` onto meta entries (GNU long-name/long-link and PAX headers), and the parser uses that value to decide how many bytes belong to the meta entry. node-tar can therefore frame an archive differently from other tar implementations. Three related places in the same code take sizes or precedence from inconsistent sources. ### Details | # | Issue | Location | Default options | |---|---|---|---| | VULN-001 | `ReadEntry` applies `ex`/`gex` `size` to meta entries, and the parser uses it to frame the meta body. This is what GHSA-vmf3 meant to prevent, through a different code path | `src/read-entry.ts:105-110` → `src/parse.ts:241,246` | Yes (`x`, `t`, `Parser`, `Unpack`, `UnpackSync`) | | VULN-004 | `maxMetaEntrySize` is checked against the PAX-overridden `entry.size`, but the meta buffer accumulates `header.size` bytes, so the limit can be exceeded | `src/parse.ts:241` (check) vs `:248` (accumulation) | Yes | | VULN-005 | `ReadEntry` applies the global header after the local one, so global values override local ones (the reverse of PAX semantics), and it applies a global `linkpath`, which `Header` excludes. Commit af04392 fixed this order in `Header` only | `src/read-entry.ts:105-110`, `:145` | Yes | | VULN-003 | When re-packing (`c`/`r`/`u` with `@archive`, or `Pack.add(ReadEntry)`), the written header size comes from `entry.size` while the body length comes from the block count. A mismatch puts extra entries into the output archive | `src/write-entry.ts:645, 667-668, 682, 713` | No (needs `@archive` / re-pack) | ### Proof of concept Each finding has a self-contained test in the attached bundle (`exploit_tests/test_vuln_00N_*.cjs`). Each test runs a normal archive (control) and a crafted one (attack) against the unmodified 7.5.22 build, and records both outputs in `exploit_tests/evidence/`. All tests were run on macOS. Behaviour on Linux and Windows wasn't checked, but the affected code is platform-independent. ### Impact An attacker who supplies an archive can make node-tar see different entries from other tar tools, for example a scanner or policy check run before extraction. A file the check didn't see can then be extracted. VULN-004 lets the meta-entry memory limit be exceeded. VULN-003 carries the inconsistency into archives node-tar itself produces from untrusted input.

CVE-2026-140236 Affected node-tar Versions

1 component(s)
Fixed Versions:
8.0.0
Product / Package Ecosystem Affected Versions Fixed Version
tar
npm
< 8.0.0
8.0.0

References

Frequently Asked Questions

What is CVE-2026-140236?
CVE-2026-140236 is a security vulnerability in node-tar involving Archive framing differential from PAX size still being applied to GNU/PAX meta entries via ReadEntry and related size/precedence inconsistencies under CWE-436: Interpretation Conflict.
Which node-tar versions are affected?
Affected versions include releases prior to 8.0.0 across affected packages: tar.
What version fixes CVE-2026-140236?
Upgrading to 8.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is tar affected?
Yes, tar is affected in releases prior to 8.0.0. Upgrade your dependency to 8.0.0 or later.
What CWE is associated with CVE-2026-140236?
CVE-2026-140236 is classified under CWE-436: Interpretation Conflict (Product A handles inputs or steps differently than Product B, which causes A to perform incorrect actions based on its perception of B's state.).
How can I check npm dependencies for CVE-2026-140236?
Run the dependency tree command: 'npm ls tar'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-qv2w-fc3h-pm27",
  "modified" : "2026-12-02T01:38:09Z",
  "published" : "2026-12-02T01:38:09Z",
  "aliases" : [ "CVE-2026-140236" ],
  "summary" : "node-tar: Archive framing differential from PAX size still being applied to GNU/PAX meta entries via ReadEntry and related size/precedence inconsistencies",
  "details" : "### Summary\n\nThe GHSA-vmf3 fix (7.5.16, commit 21a8220) stopped `Header.decode` from applying extended-header values to non-file blocks. `ReadEntry`, however, still copies the PAX `size` onto meta entries (GNU long-name/long-link and PAX headers), and the parser uses that value to decide how many bytes belong to the meta entry. node-tar can therefore frame an archive differently from other tar implementations. Three related places in the same code take sizes or precedence from inconsistent sources.\n\n\n### Details\n\n| # | Issue | Location | Default options |\n|---|---|---|---|\n| VULN-001 | `ReadEntry` applies `ex`/`gex` `size` to meta entries, and the parser uses it to frame the meta body. This is what GHSA-vmf3 meant to prevent, through a different code path | `src/read-entry.ts:105-110` → `src/parse.ts:241,246` | Yes (`x`, `t`, `Parser`, `Unpack`, `UnpackSync`) |\n| VULN-004 | `maxMetaEntrySize` is checked against the PAX-overridden `entry.size`, but the meta buffer accumulates `header.size` bytes, so the limit can be exceeded | `src/parse.ts:241` (check) vs `:248` (accumulation) | Yes |\n| VULN-005 | `ReadEntry` applies the global header after the local one, so global values override local ones (the reverse of PAX semantics), and it applies a global `linkpath`, which `Header` excludes. Commit af04392 fixed this order in `Header` only | `src/read-entry.ts:105-110`, `:145` | Yes |\n| VULN-003 | When re-packing (`c`/`r`/`u` with `@archive`, or `Pack.add(ReadEntry)`), the written header size comes from `entry.size` while the body length comes from the block count. A mismatch puts extra entries into the output archive | `src/write-entry.ts:645, 667-668, 682, 713` | No (needs `@archive` / re-pack) |\n\n\n### Proof of concept\n\nEach finding has a self-contained test in the attached bundle (`exploit_tests/test_vuln_00N_*.cjs`). Each test runs a normal archive (control) and a crafted one (attack) against the unmodified 7.5.22 build, and records both outputs in `exploit_tests/evidence/`. All tests were run on macOS. Behaviour on Linux and Windows wasn't checked, but the affected code is platform-independent.\n\n\n### Impact\n\nAn attacker who supplies an archive can make node-tar see different entries from other tar tools, for example a scanner or policy check run before extraction. A file the check didn't see can then be extracted. VULN-004 lets the meta-entry memory limit be exceeded. VULN-003 carries the inconsistency into archives node-tar itself produces from untrusted input.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "tar"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "8.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/isaacs/node-tar/security/advisories/GHSA-qv2w-fc3h-pm27"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-140236"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/isaacs/node-tar/commit/f351e5b4a8916bc8c8f821d0ad926a17d26ea237"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/isaacs/node-tar"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/isaacs/node-tar/releases/tag/v8.0.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-436" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-12-02T01:38:09Z",
    "nvd_published_at" : "2026-12-01T18:17:27Z"
  }
}