Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
HIGH severity

CVE-2021-32804 — tar

HIGHFix: npm/node-tar@1f036ca

CVE-2021-32804 is a high-severity (CVSS 8.1) Path Traversal vulnerability in tar. EPSS puts its 30-day exploitation probability at 15.1% (97th percentile). A fix is available for tar — see the affected versions and patch details below.

Arbitrary File Creation/Overwrite due to insufficient absolute path sanitization

Also known asGHSA-3jfq-g458-7qm9
Published
Updated
Affected
4 pkgs
Patched
4 / 4
Exploits
None indexed
Exploitation data as of Oct 11, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

EPSS Exploitation Probability

via FIRST.org ↗
15.1%probability of exploitation in next 30 days
Moderate Risk-0.07%
Lower risk than most CVEs97th percentile — riskier than 97% of all scored CVEsHighest risk
0.00%33.3%66.7%100.0%85.0%15.1%Apr 26Aug 26Oct 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

CVE-2021-32804 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.

Where this sits among everything scored

Of 385,987 CVEs with a current EPSS score, this one falls in the 10–50% band (highlighted). Counts from FIRST.org, log-scaled.

Real-World Exposure

4 pkgs affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

8Kother npm packages depend on this — each one inherits the vulnerability until it's patched upstream
tarnpm
90.1Mdownloads / week

Description

Impact

Arbitrary File Creation, Arbitrary File Overwrite, Arbitrary Code Execution

node-tar aims to prevent extraction of absolute file paths by turning absolute paths into relative paths when the preservePaths flag is not set to true. This is achieved by stripping the absolute path root from any absolute file paths contained in a tar file. For example /home/user/.bashrc would turn into home/user/.bashrc.

This logic was insufficient when file paths contained repeated path roots such as ////home/user/.bashrc. node-tar would only strip a single path root from such paths. When given an absolute file path with repeating path roots, the resulting path (e.g. ///home/user/.bashrc) would still resolve to an absolute path, thus allowing arbitrary file creation and overwrite.

Patches

3.2.2 || 4.4.14 || 5.0.6 || 6.1.1

NOTE: an adjacent issue CVE-2021-32803 affects this release level. Please ensure you update to the latest patch levels that address CVE-2021-32803 as well if this adjacent issue affects your node-tar use case.

Workarounds

Users may work around this vulnerability without upgrading by creating a custom onentry method which sanitizes the entry.path or a filter method which removes entries with absolute paths.

const path = require('path')
const tar = require('tar')

tar.x({
  file: 'archive.tgz',
  // either add this function...
  onentry: (entry) => {
    if (path.isAbsolute(entry.path)) {
      entry.path = sanitizeAbsolutePathSomehow(entry.path)
      entry.absolute = path.resolve(entry.path)
    }
  },

  // or this one
  filter: (file, entry) => {
    if (path.isAbsolute(entry.path)) {
      return false
    } else {
      return true
    }
  }
})

Users are encouraged to upgrade to the latest patch versions, rather than attempt to sanitize tar input themselves.

Affected Packages

4 total 4 fixed
EcosystemPackageVulnerable rangeFix
📦npmtarall versions3.2.2npm install tar@3.2.2
📦npmtar≥ 4.0.0&&< 4.4.144.4.14npm install tar@4.4.14
📦npmtar≥ 5.0.0&&< 5.0.65.0.6npm install tar@5.0.6
📦npmtar≥ 6.0.0&&< 6.1.16.1.1npm install tar@6.1.1

Affected Products

3 products · 7 configurations
Application
graalvmoracle
2 versions
20.3.321.2.0
Application
sinec infrastructure network servicessiemens
< 1.0.1.1
range
Application
tartar_project
≥ 6.0.0 && < 6.1.1
range

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for tar, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update tar to 3.2.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-32804 is resolved across your whole dependency graph.

  3. Workarounds

    Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.

Fixing This On Your OS

If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.

Red HatModerate

Red Hat Quay 3.3 uses an affected version of nodejs-tar. However Quay 3.3 is in extended life phase and a fix will not be delivered[1]. More recent versions of Red Hat Quay do not include nodejs-tar and are not affected. 1. https://access.redhat.com/support/policy/updates/rhquay Red Hat Enterprise Linux version 8 and…

ProductFixed inAdvisory
Red Hat Enterprise Linux 8nodejs:12-8040020210817133458.522a0ee4RHSA-2021:3623
Red Hat Enterprise Linux 8nodejs:14-8040020210817165654.522a0ee4RHSA-2021:3666
Red Hat Enterprise Linux 8.1 Extended Update Supportnodejs:12-8010020210817113128.c27ad7f8RHSA-2021:3639
Red Hat Enterprise Linux 8.2 Extended Update Supportnodejs:12-8020020210817125332.4cda2c84RHSA-2021:3638
Red Hat OpenShift Data Foundation 4.9.0 on RHEL-8odf4/cephcsi-rhel8:4.9-164.57484e3.release_4.9RHSA-2021:5086
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-nodejs14-nodejs-0:14.17.5-1.el7RHSA-2021:3280
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-nodejs12-nodejs-0:12.22.5-1.el7RHSA-2021:3281

Frequently Asked Questions

### Impact Arbitrary File Creation, Arbitrary File Overwrite, Arbitrary Code Execution `node-tar` aims to prevent extraction of absolute file paths by turning absolute paths into relative paths when the `preservePaths` flag is not set to `true`. This is achieved by stripping the absolute path root from any absolute file paths contained in a tar file. For example `/home/user/.bashrc` would turn into `home/user/.bashrc`. This logic was insufficient when file paths contained repeated path roots such as `////home/user/.bashrc`. `node-tar` would only strip a single path root from such paths. Wh
O3 Security · Impact-Aware SCA

Is CVE-2021-32804 in your dependencies?

Find it across npm, including transitive dependencies.

CVE-2021-32804: tar RCE — Fixed in 3.2.2