CVE-2021-37713 json
Arbitrary File Creation/Overwrite on Windows via insufficient relative path sanitization
published 2021-08-31 5 y ago modified 2026-07-08 4 mo ago also GHSA-5955-9wpr-37jh , EUVD-2021-1573
- cvss
- 8.2
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.3%
- EPSS 1.3% chance of exploitation in 30 days, percentile 70%
- public exploits
- 0
- none known
Summary
The npm package "tar" (aka node-tar) before versions 4.4.18, 5.0.10, and 6.1.9 has an arbitrary file creation/overwrite and arbitrary code execution vulnerability. node-tar aims to guarantee that any file whose location would be outside of the extraction target directory is not extracted. This is, in part, accomplished by sanitizing absolute paths of entries within the archive, skipping archive entries that contain `..` path portions, and resolving the sanitized paths against the extraction target directory. This logic was insufficient on Windows systems when extracting tar files that contained a path that was not an absolute path, but specified a drive letter different from the extraction target, such as `C:some\path`. If the drive letter does not match the extraction target, for example `D:\extraction\dir`, then the result of `path.resolve(extractionDirectory, entryPath)` would resolve against the current working directory on the `C:` drive, rather than the extraction target directory. Additionally, a `..` portion of the path could occur immediately after the drive letter, such as `C:../foo`, and was not properly sanitized by the logic that checked for `..` within the normalized and split portions of the path. This only affects users of `node-tar` on Windows systems. These issues were addressed in releases 4.4.18, 5.0.10 and 6.1.9. 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. There is no reasonable way to work around this issue without performing the same path normalization procedures that node-tar now does. Users are encouraged to upgrade to the latest patched versions of node-tar, rather than attempt to sanitize paths themselves.
Patch / fix
- npm tar 4.4.18, 5.0.10, 6.1.9
- npmjs tar 4.4.18, 5.0.10, 6.1.9
- siemens sinec_infrastructure_network_services 1.0.1.1
- nodejs12 SLE Module for Web and Scripting 12 12.22.9-1.38.1
- nodejs14 SLE Module for Web and Scripting 15 SP3, SLE Module for Web and Scripting 15 SP2 14.18.1-15.21.2
- nodejs12 SLE Module for Web and Scripting 15 SP3, SLE Module for Web and Scripting 15 SP2 12.22.7-4.22.1
- nodejs14 SLE Module for Web and Scripting 12 14.18.1-6.18.2
suse advisories SUSE-SU-2022:0101-1SUSE-SU-2021:3964-1SUSE-SU-2021:3940-1SUSE-SU-2021:3886-1
- nodejs14 openSUSE Tumbleweed 14.18.1-1.1
- nodejs12 openSUSE Leap 15.2 12.22.7-lp152.3.21.1
- nodejs14 openSUSE Leap 15.2 14.18.1-lp152.17.1
- nodejs14 openSUSE Leap 15.3 14.18.1-15.21.2
- nodejs12 openSUSE Leap 15.3 12.22.7-4.22.1
opensuse advisories openSUSE-SU-2024:11616-1openSUSE-SU-2021:1574-1openSUSE-SU-2021:1552-1openSUSE-SU-2021:3964-1openSUSE-SU-2021:3940-1
- nodejs Alpine 3.12, Alpine 3.11 12.22.6-r0
- nodejs Alpine 3.24, Alpine 3.23, Alpine 3.22 +9 more 14.17.6-r0
alpine advisories ALPINE-CVE-2021-37713
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- github.com/isaacs/node-tar@52b09e3 commit
- github.com/isaacs/node-tar@82eac95 commit
- github.com/isaacs/node-tar@875a37e commit
- github.com/npm/node-tar/security/advisories/GHSA-5955-9wpr-37jh advisory
- oracle.com/security-alerts/cpuoct2021.html advisory
- cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf advisory
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2021-37713 updated cvss 8.2
nodejs-tar: Arbitrary File Creation/Overwrite on Windows via insufficient relative path sanitization
-
Red Hat OpenShift Container Platform 4 openshift4/ose-grafananot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
cisa ICSA-22-069-09 updated cvss 8.6
Siemens SINEC INS
-
Siemens SINEC INS <V1.0.1.1affected: fixed in V1.0.1.1 support.industry.siemens.com
Facts from CISA's republication of the vendor's own advisory (CSAF); the linked advisory is the authoritative source. CISA notification · csaf
Exploit prediction
1.27% chance of exploitation in the next 30 days, higher than 70% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 8.2 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N |
| NVD | 3.1 | 8.6 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H |
| NVD | 2.0 | 4.4 | AV:L/AC:M/Au:N/C:P/I:P/A:P |
| GitHub | 3.1 | 8.2 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| npm | tar | <4.4.18 >=5.0.0, <5.0.10 >=6.0.0, <6.1.9 |
4.4.18 5.0.10 6.1.9 |
Affected products
- npm node-tar
Classification
- Weakness
-
- CWE-22 Improper Limitation of a Pathname to a Restricted Directory
References
-
github.com
/npm/node-tar/security/advisories/GHSA-5955-9wpr-37jh
web, patch, third-party-advisory
-
oracle.com
/security-alerts/cpuoct2021.html
web, patch, third-party-advisory
-
cert-portal.siemens.com
/productcert/pdf/ssa-389290.pdf
web, patch, third-party-advisory
-
github.com
/isaacs/node-tar/commit/52b09e309bcae0c741a7eb79a17ef36e7828b946
web
-
github.com
/isaacs/node-tar/commit/82eac952f7c10765969ed464e549375854b26edc
web
-
github.com
/isaacs/node-tar/commit/875a37e3ec031186fc6599f6807341f56c584598
web
-
npmjs.com
/package/tar
web, product, third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2021-37713
advisory
-
github.com
/npm/node-tar
package
Sources
- CVE List CVE-2021-37713
- GitHub Advisory GHSA-5955-9wpr-37jh
- NVD CVE-2021-37713
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.