Home/Research/Post

GHSA-98v3-7xjr-fg83: node-tar async extraction deadlocks permanently when an entry’s linkpath is a hierarchical relative of its own path

  • Severity: HIGH
  • CVE: CVE-2026-140251
  • Ecosystems: npm
  • Packages: tar

### Summary
An unauthenticated remote-input denial of service allows a crafted tar archive of about 1.5 KB to permanently and silently hang node-tar’s default asynchronous extraction. When a `Link` or `SymbolicLink` entry has a `linkpath` that is an ancestor (or descendant) directory of the entry’s own `path`, the internal path-reservation queue enters an unsatisfiable state. The promise returned by `tar.x()` / `tar.extract()` never resolves or rejects, the stream never emits `end` / `finish` / `close`, and no warning is raised. Every entry after the poison entry is silently skipped.

### Details
Async `Unpack` serialises filesystem work through `PathReservations` (`src/path-reservations.ts`). `reserve([entry.path, entry.linkpath], fn)` registers each reserved path as a plain function at that path’s queue key, and every ancestor directory of each path as a `Set` at that directory’s queue key.

`check(fn)` (src/path-reservations.ts:114-120) only schedules `fn` when it is the head function of every path queue AND the head of every directory queue is a `Set` that contains `fn`:

“`ts
check(fn) {
const { paths, dirs } = this.#getQueues(fn)
return (
paths.every(q => q && q[0] === fn) &&
dirs.every(q => q && q[0] instanceof Set && q[0].has(fn))
)
}
“`

When one of the two reserved strings is an ancestor directory of the other, the same queue key is written twice: once as a function head (the path reservation, src/path-reservations.ts:65-72) and once as a directory `Set` (the…

Source: GitHub Security Advisories · 2026-12-02