Skip to main content
Public proof of conceptFix available

CVE-2021-32804

A public proof of concept exists; no exploitation attested.

  • Published2021-08-03
  • Fixed in6.1.1 · 5.0.6 · 4.4.14 · 3.2.2
  • WeaknessCWE-22

Am I affected?

With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.

Description

The npm package "tar" (aka node-tar) before versions 6.1.1, 5.0.6, 4.4.14, and 3.3.2 has a arbitrary File Creation/Overwrite vulnerability due to insufficient absolute path sanitization. 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. This issue was addressed in releases 3.2.2, 4.4.14, 5.0.6 and 6.1.1. 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. See referenced GitHub Advisory for details. Be aware of CVE-2021-32803 which fixes a similar bug in later versions of tar.

Timeline

dates in UTC
  1. 2021-08-0319:15CVE publishedNVD
  2. 2026-10-2319:23First public proof of conceptPoC-in-GitHub
  3. 2026-10-2319:23EPSS crossed 10 %FIRST EPSS

Observed activity

isMalicious corpus · updated 2026-10-23 21:37 UTC
Indicators tagged with this CVE, per day0 indicators over 7 days
Block these indicators
  • Firewall list (EDL, text): https://api.ismalicious.com/edl/cve/CVE-2021-32804?format=txt
  • CSV export: https://api.ismalicious.com/edl/cve/CVE-2021-32804?format=csv
  • TAXII collection of exploited CVEs
  • The EDL and CSV take an API key on the Pro plan.

Versions per branch

NVD · OSV
Tar project tar
BranchAffectedFixed in
6.x≥ 6.0.0, < 6.1.16.1.1
5.0≥ 5.0.0, < 5.0.65.0.6
4.x≥ 4.0.0, < 4.4.144.4.14
3.2< 3.2.23.2.2
Oracle graalvm
BranchAffectedFixed in
20.3= 20.3.3no fix published
21.2= 21.2.0no fix published
Siemens sinec infrastructure network services
BranchAffectedFixed in
1.0< 1.0.1.11.0.1.1

as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.

Distribution builds and vendor advisories

Packages from OSV.dev and products from the vendors' CSAF advisories.

version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.

Packages

  • nodejsAlmaLinux:8all versions · fixed in 1:12.22.5-1.module_el8.4.0+2529+af52a4c7and 3 other packages
  • nodejsAlmaLinux:8all versions · fixed in 1:12.22.5-1.module_el8.5.0+85+79a7b441and 2 other packages
  • nodejs-nodemonAlmaLinux:8all versions · fixed in 2.0.3-1.module_el8.4.0+2521+c668cc9f
  • nodejs-packagingAlmaLinux:8all versions · fixed in 17-3.module_el8.3.0+2023+d2377ea3
  • nodejs-packagingAlmaLinux:8all versions · fixed in 17-3.module_el8.4.0+2224+b07ac28e
  • nodejs-packagingAlmaLinux:8all versions · fixed in 17-3.module_el8.4.0+2521+c668cc9f
  • nodejs-packagingAlmaLinux:8all versions · fixed in 23-3.module_el8.4.0+2522+3bd42762
  • nodejs-packagingAlmaLinux:8all versions · fixed in 23-3.module_el8.5.0+254+b4526b16

2 more package ranges on OSV.dev

Full record on NVD

Fix

  1. Update Tar project tar to 6.1.1 · 5.0.6 · 4.4.14 · 3.2.2

Advisories and patches

Detection

read 2026-10-23 19:23 UTC
Nuclei template
none so far
ProjectDiscovery
Exploit-DB
no entry
Exploit-DB
Proof-of-concept repositories
1 repository, unverifiedyamory/CVE-2021-32804
PoC-in-GitHub

Sources

  • CNACVSS 3.18.2read 2026-10-23
  • NVDCVSS 3.18.1read 2026-10-23
  • NVDCVSS 2.05.8read 2026-10-23
  • CNAweakness (CWE)CWE-22read 2026-10-23
  • NVDweakness (CWE)CWE-22read 2026-10-23
  • FIRST EPSSEPSS score15.1 %read 2026-10-23
  • PoC-in-GitHubproof of concept1read 2026-10-23
  • OSVaffected packages—

Technical details

CVSS v3 Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H
Published
2021-08-03
Last Modified
2026-06-17
NVD status
Modified

Frequently asked questions

What is CVE-2021-32804?

The npm package "tar" (aka node-tar) before versions 6.1.1, 5.0.6, 4.4.14, and 3.3.2 has a arbitrary File Creation/Overwrite vulnerability due to insufficient absolute path sanitization. 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. This issue was addressed in releases 3.2.2, 4.4.14, 5.0.6 and 6.1.1. 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. See referenced GitHub Advisory for details. Be aware of CVE-2021-32803 which fixes a similar bug in later versions of tar.

Is CVE-2021-32804 actively exploited?

Active exploitation of CVE-2021-32804 has not been confirmed. Its EPSS score was 15.1% on 2026-10-23, the estimated probability of exploitation in the next 30 days.

What is the CVSS score for CVE-2021-32804?

CVE-2021-32804 has a CVSS v3 base score of 8.1 (HIGH severity), with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H.

Running tar? Hear about its next vulnerability

Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».

No credit card required · No monthly cap on website lookups · 250 API requests/month