CVE-2021-32803 | Arbitrary File Creation/Overwrite via insufficient symlink protection due to directory cache poisoning

The npm package "tar" (aka node-tar) before versions 6.1.2, 5.0.7, 4.4.15, and 3.2.3 has an arbitrary File Creation/Overwrite vulnerability via insufficient symlink protection. `node-tar` aims to guarantee that any file whose location would be modified by a symbolic link is not extracted. This is, in part, achieved by ensuring that extracted directories are not symlinks. Additionally, in order to prevent unnecessary `stat` calls to determine whether a given path is a directory, paths are cached when directories are created. This logic was insufficient when extracting tar files that contained both a directory and a symlink with the same name as the directory. This order of operations resulted in the directory being created and added to the `node-tar` directory cache. When a directory is present in the directory cache, subsequent calls to mkdir for that directory are skipped. However, this is also where `node-tar` checks for symlinks occur. By first creating a directory, and then replacing that directory with a symlink, it was thus possible to bypass `node-tar` symlink checks on directories, essentially allowing an untrusted tar file to symlink into an arbitrary location and subsequently extracting arbitrary files into that location, thus allowing arbitrary file creation and overwrite. This issue was addressed in releases 3.2.3, 4.4.15, 5.0.7 and 6.1.2.

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

Conclusion & alert: CVE-2021-32803 is rated Moderate Risk (43.5/100): CVSS High severity, with low exploitation likelihood (EPSS 0.12%). Mandatory action: Review affected assets and schedule 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-32803

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-05-06 0.16% 0.12% -0.04%
2 2026-03-15 0.15% 0.16% +0.01%
3 2026-02-19 0.15%

Full EPSS history (17 records total)

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

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-32803

GitHub Security Advisory for CVE-2021-32803

GHSA-r628-mhmh-qjhw · Severity: high · Ecosystem: npm — Arbitrary File Creation/Overwrite via insufficient symlink protection due to directory cache poisoning

OS Trackers for CVE-2021-32803

vendor priority summary link
alpine high CVE-2021-32803: 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-32803
debian not yet assigned CVE-2021-32803 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-32803
redhat medium https://access.redhat.com/security/cve/CVE-2021-32803
suse high CVE-2021-32803 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-32803/
ubuntu medium CVE-2021-32803 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): not-affected 11, released 2, ignored 1, needs-triage 1. https://ubuntu.com/security/CVE-2021-32803

Affected software / configurations for CVE-2021-32803

Vendor Product Version Raw CPE
tar_project tar < 3.2.3 cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:*
tar_project tar >= 4.0.0, < 4.4.15 cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:*
tar_project tar >= 5.0.0, < 5.0.7 cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:*
tar_project tar >= 6.0.0, < 6.1.2 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-32803

cvelogic Threat Intelligence