CVE-2021-37701 | Arbitrary File Creation/Overwrite via insufficient symlink protection due to directory cache poisoning using symbolic links

The npm package "tar" (aka node-tar) before versions 4.4.16, 5.0.8, and 6.1.7 has an arbitrary file creation/overwrite and arbitrary code execution vulnerability. 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, where the symlink and directory names in the archive entry used backslashes as a path separator on posix systems. The cache checking logic used both `\` and `/` characters as path separators, however `\` is a valid filename character on posix systems. 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. Additionally, a similar confusion could arise on case-insensitive filesystems. If a tar archive contained a directory at `FOO`, followed by a symbolic link named `foo`, then on case-insensitive file systems, the creation of the symbolic link would remove the directory from the filesystem, but _not_ from the internal directory cache, as it would not be treated as a cache hit. A subsequent file entry within the `FOO` directory would then be placed in the target of the symbolic link, thinking that the directory had already been created. These issues were addressed in releases 4.4.16, 5.0.8 and 6.1.7. The v3 branch of node-tar has been deprecated and did not receive patches for these issues. If you are still using a v3 release we recommend you update to a more recent version of node-tar. If this is not possible, a workaround is available in the referenced GHSA-9r2w-394v-53qc.

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

Conclusion & alert: CVE-2021-37701 is rated Moderate Risk (43.4/100): CVSS High severity, with low exploitation likelihood (EPSS 0.11%). 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-37701

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-03-03 0.03% 0.11% +0.09%
2 2025-11-21 0.45% 0.03% -0.43%
3 2025-11-18 0.45%

Full EPSS history (17 records total)

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

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.6 3.1 HIGH
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H 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:H)
Could take the service down hard or make it unusable for people who depend on it.
1.8 6.0 [email protected]
4.4 2.0 MEDIUM
AV:L/AC:M/Au:N/C:P/I:P/A:P Click to expand
Access vector (AV:L)
Requires local access to the target system.
Access complexity (AC:M)
Exploitation needs some favorable conditions, but not exceptional ones.
Authentication (AU:N)
No authentication is required.
Confidentiality impact (C:P)
Partial confidentiality impact.
Integrity impact (I:P)
Partial integrity impact.
Availability impact (A:P)
Partial availability impact.
3.4 6.4 [email protected]

Weakness enumeration for CVE-2021-37701

GitHub Security Advisory for CVE-2021-37701

GHSA-9r2w-394v-53qc · Severity: high · Ecosystem: npm — Arbitrary File Creation/Overwrite via insufficient symlink protection due to directory cache poisoning using symbolic links

OS Trackers for CVE-2021-37701

vendor priority summary link
alpine high CVE-2021-37701: 2 source package rows (nodejs, tar); 47 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 45, open 2. https://security.alpinelinux.org/vuln/CVE-2021-37701
debian not yet assigned CVE-2021-37701 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-37701
gentoo low CVE-2021-37701: 1 GLSA(s) (202405-29), 1 atom(s) (net-libs/nodejs); latest impact low. https://bugs.gentoo.org/buglist.cgi?quicksearch=CVE-2021-37701
redhat medium https://access.redhat.com/security/cve/CVE-2021-37701
suse high CVE-2021-37701 severity important: SUSE including 43 source package names (12-10.1:nodejs12-12.22.7-4.22.1, 12-10.1:npm12-12.22.7-4.22.1, …), 95 product×package rows across 12 product lines (Container bci/nodejs, SUSE Liberty Linux 8, … (12 product lines)): Fixed 87, Known Not Affected 8. https://www.suse.com/security/cve/CVE-2021-37701/
ubuntu medium CVE-2021-37701 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 9, needs-triage 4, ignored 1, released 1. https://ubuntu.com/security/CVE-2021-37701

Affected software / configurations for CVE-2021-37701

Vendor Product Version Raw CPE
npmjs tar < 4.4.16 cpe:2.3:a:npmjs:tar:*:*:*:*:*:node.js:*:*
npmjs tar >= 5.0.0, < 5.0.8 cpe:2.3:a:npmjs:tar:*:*:*:*:*:node.js:*:*
npmjs tar >= 6.0.0, < 6.1.7 cpe:2.3:a:npmjs:tar:*:*:*:*:*:node.js:*:*
debian debian_linux 10.0 cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*
debian debian_linux 11.0 cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*
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-37701

cvelogic Threat Intelligence