Skip to content
Fencer Vulns
high 8.2

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

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-grafana
    not 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

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

Sources

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.