CVE-2021-32804 | Arbitrary File Creation/Overwrite due to insufficient absolute path sanitization

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.

Published: 2021-08-03 Last update: 2024-11-21 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2021-32804 is rated High Risk (67/100): CVSS High severity, with high exploitation likelihood (EPSS 84.98%, 99th percentile). Core evidence: EPSS ranks this CVE among the most likely to be exploited in the near term. Mandatory action: High exploitation likelihood—assess exposure and prioritize remediation.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Exploit prediction scoring system (EPSS) score for CVE-2021-32804

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-01-29 85.52% 84.98% -0.53%
2 2025-11-21 16.95% 85.52% +68.56%
3 2025-11-18 16.95%

Full EPSS history (28 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2021-32804

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
8.2 3.1 HIGH
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N Click to expand
Attack vector (AV:L)
They already need access on the box, or another person has to do something wrong; it’s not a remote drive-by.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:R)
A real person has to do something—click, install, enable—otherwise it doesn’t land.
Scope (S:C)
Breaking this can reach past the original component and bite other resources—bigger blast radius.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:N)
Service keeps running; no real outage angle.
1.8 5.8 [email protected]
8.1 3.1 HIGH
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:R)
A real person has to do something—click, install, enable—otherwise it doesn’t land.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:N)
Doesn’t really leak secrets in a meaningful way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
2.8 5.2 [email protected]
5.8 2.0 MEDIUM
AV:N/AC:M/Au:N/C:N/I:P/A:P Click to expand
Access vector (AV:N)
Can be exploited remotely over network reachability.
Access complexity (AC:M)
Exploitation needs some favorable conditions, but not exceptional ones.
Authentication (AU:N)
No authentication is required.
Confidentiality impact (C:N)
No confidentiality impact.
Integrity impact (I:P)
Partial integrity impact.
Availability impact (A:P)
Partial availability impact.
8.6 4.9 [email protected]

Weakness enumeration for CVE-2021-32804

GitHub Security Advisory for CVE-2021-32804

GHSA-3jfq-g458-7qm9 · Severity: high · Ecosystem: npm — Arbitrary File Creation/Overwrite due to insufficient absolute path sanitization

OS Trackers for CVE-2021-32804

vendor priority summary link
alpine high CVE-2021-32804: 1 source package rows (tar); 38 state rows across 10 repos (3.11-main, 3.12-main, 3.17-main, 3.18-main, 3.19-main, 3.20-main, 3.21-main, 3.22-main, 3.23-main, edge-main); fixed 36, open 2. https://security.alpinelinux.org/vuln/CVE-2021-32804
debian not yet assigned CVE-2021-32804 not yet assigned priority: Debian including 1 source packages (node-tar), 5 status rows across 5 suites (bookworm, bullseye, forky, sid, trixie): resolved 5. https://security-tracker.debian.org/tracker/CVE-2021-32804
redhat medium https://access.redhat.com/security/cve/CVE-2021-32804
suse high CVE-2021-32804 severity important: SUSE including 61 source package names (12-11.15:nodejs12-12.22.10-4.29.3, 12-11.15:npm12-12.22.10-4.29.3, …), 387 product×package rows across 34 product lines (Container bci/nodejs, SUSE CaaS Platform 4.0, … (34 product lines)): Fixed 367, Known Not Affected 20. https://www.suse.com/security/cve/CVE-2021-32804/
ubuntu medium CVE-2021-32804 medium priority: Ubuntu including 1 source packages (node-tar), 15 status rows across 15 suites (bionic, focal, hirsute, impish, jammy, kinetic, lunar, mantic, noble, oracular, plucky, questing, trusty, upstream, xenial): needs-triage 8, ignored 7. https://ubuntu.com/security/CVE-2021-32804

Affected software / configurations for CVE-2021-32804

Vendor Product Version Raw CPE
tar_project tar < 3.2.2 cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:*
tar_project tar >= 4.0.0, < 4.4.14 cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:*
tar_project tar >= 5.0.0, < 5.0.6 cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:*
tar_project tar >= 6.0.0, < 6.1.1 cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:*
oracle graalvm 20.3.3 cpe:2.3:a:oracle:graalvm:20.3.3:*:*:*:enterprise:*:*:*
oracle graalvm 21.2.0 cpe:2.3:a:oracle:graalvm:21.2.0:*:*:*:enterprise:*:*:*
siemens sinec_infrastructure_network_services < 1.0.1.1 cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:*

References for CVE-2021-32804

cvelogic Threat Intelligence