Let’s talk
Back to Writing
•6 min read•
node-tarnpmNode.jssupply chain securitySaaS security

node-tar's 18 Security Advisories: The Fix Is a Major Upgrade. What to Do Today

An open archive box with files sliding into a folder tray, one file crossing a dashed boundary, next to a shield, a wrench and a checklist

Early on December 2, 2026, GitHub published 18 reviewed security advisories for tar, the npm package better known as node-tar. Seventeen are rated high and one medium. Almost all of them are fixed only in tar 8, a new major version with a different API that needs Node.js 22 or later. The maintainer's README says old versions get no fixes.

node-tar is one of the most installed packages on npm: about 113 million downloads in the week of November 24–30. Most teams never import it directly. It reaches them through the npm CLI, node-gyp and other build tools. If your SaaS extracts archives that users or the internet can supply, check today. If tar only reaches you through tooling, there is less to do.

What Happened

The advisories (CVE-2026-140234 to CVE-2026-140252) fall into three groups, all listed in the GitHub Advisory Database:

  • Symbolic links escaping the extraction folder (7 advisories). node-tar promises that link entries can't point outside the folder you extract into. Its check was lexical, so chains of links in the same archive got past it. GHSA-gvrf-jx37-rjv5 shows an archive that first creates l1 -> . and then esc -> l1/../outside.txt. The path looks inside the folder but resolves to its parent, and node-tar prints no warning. Other variants use backslashes on non-Windows hosts, paths ending in /., and nested links.
  • Header parsing tricks (6 advisories). Flaws in how node-tar read PAX and GNU headers let an archive forge an entry's path, link target or size, or hide one file inside another's metadata. In GHSA-mpg7-vg3p-wc3m, a newline in a PAX value creates a fake record that overrides the entry's real path. The reporter says they used it on a real Windows machine to overwrite package.json inside an installed npm package and run an injected postinstall script.
  • Crashes and hangs (5 advisories). Small crafted archives that use up memory or CPU, throw an uncaught exception, or deadlock async and sync extraction for good.

The CVSS 4.0 scores run from 6.9 to 7.2. The advisories don't report any exploitation, and none of the CVEs were in CISA's Known Exploited Vulnerabilities catalog as of its November 30 update.

Who Is Affected

Fixed versions (from the advisory ranges):

  • 16 advisories: fixed in 8.0.0.
  • The memory exhaustion bug (GHSA-7c32-79xj-j3jp): fixed in 8.0.2.
  • The non-finite PAX size bug (GHSA-ph3c-p786-j4rp): the only one with a 7.x fix, 7.5.24.

The current release is 8.0.5 (December 2). Some advisories list every version below 8.0.0. Others start at 7.0.0, 7.5.0, 7.5.5 or 7.5.22, depending on when the bug was introduced. In practice, any tar 7 or older is affected by most of them.

You are most exposed if your code or a runtime dependency calls tar.x(), tar.extract(), Unpack or Parser on an archive you don't control. Common examples are import or restore features, plugin and theme installers, template or starter downloaders, backup restore jobs, and workers that unpack customer uploads.

Your build tooling is also on tar 7. The latest npm CLI (12.2.3) depends on tar ^7.5.22, pacote on ^7.4.3 and node-gyp on ^7.5.7, according to their package metadata on the npm registry. As of today no npm release ships tar 8, and the open 12.2.4 release PR doesn't bump it. Not confirmed: how many of these bugs can be reached through npm install itself, given the options npm passes to tar. The advisories don't say, and neither npm nor GitHub has published a statement.

What to Do Today

  1. Find every copy. Run npm ls tar --all (or pnpm why tar, or yarn why tar) in each service and worker. Note which copies are direct dependencies of your code and which arrive through tools.
  2. Find who extracts untrusted archives. Search your code for from 'tar', require('tar'), tar.x(, extract( and new Unpack. For each hit, ask where the archive comes from. If a user, a customer or a URL decides what is in it, that code path matters most.
  3. Upgrade those direct uses to tar@^8.0.5. Plan this as a port, not a version bump. tar 8 needs Node.js 22 or later and has no callbacks and no Node streams: commands return promises, sync: true becomes extractSync() and the other *Sync functions, and only the tar, tar/core, tar/raw and tar/core/raw subpaths remain. Work through the migration table in the node-tar README. If a service is still on Node 18 or 20, the Node upgrade comes first.
  4. Don't force tar 8 onto tools with overrides or resolutions. npm, pacote and node-gyp are written against the tar 7 API, so forcing a new major under them is likely to break installs. Wait for their own releases.
  5. Harden extraction while you port. The README's security section recommends a filter that refuses SymbolicLink and Link entries for archives you don't trust, and limits on entry size. Also extract into a new empty folder that no other process writes to. Run the job in a container or worker that holds no production secrets, so a file written in the wrong place can't reach anything valuable.
  6. Don't rely on scanning first. Several of these bugs are differences between how node-tar and other tools read the same archive. If you inspect an upload with one tool and extract it with node-tar, the two may not see the same files. This is our reading of the advisories, not a statement in them.
  7. Reduce risk from installs until npm ships a fix. Install with npm ci from a committed lockfile, so every tarball has to match its recorded integrity hash. Don't run installs for fork pull requests in CI jobs that hold secrets.

How to Verify You're Safe

  • npm ls tar --all shows 8.0.5 or later for every copy your own code imports. Copies that come only through npm, pacote or node-gyp are tracked as an open item, not ignored.
  • A regression test feeds your upload path the two-link archive from GHSA-gvrf-jx37-rjv5 and checks that nothing appears outside the extraction folder. Your filter should reject the link entries outright.
  • Your Dependabot or Renovate alerts for tar are closed by real upgrades, not dismissed. Expect alerts in almost every Node.js lockfile, including ones where tar is only a tool dependency.

What to Watch Next

  • An npm CLI release that moves to tar 8, and the Node.js releases that bundle it. Until then, every Node.js install ships an npm that uses tar 7.
  • node-gyp and pacote releases on tar 8.
  • Any statement from npm or GitHub on whether registry installs are exploitable, and any report of exploitation or a KEV listing.

Related Reading

Next Step

If no code you own extracts untrusted archives, steps 1 and 7 are most of the work, plus watching for the npm release. If you do have an upload or import path, the tar 8 port often brings two other jobs with it: a Node.js upgrade on older services, and sandboxing a worker that currently runs next to production secrets. The production readiness upgrade service covers that kind of work. Bring the npm ls tar --all output and a list of the features that accept archives.

Working on a SaaS that's starting to feel fragile?

Talk to an engineer about the parts that break first — without rewriting what already works. We'll recommend focused support or a compact team based on your scope.

Talk to an Engineer