# CVE-2021-37713: Arbitrary File Creation/Overwrite on Windows via insufficient relative path sanitization

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 8.2
- **CVSS:** 8.2 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: None; User interaction: Required; Scope: Changed (impact reaches other components); Confidentiality impact: High; Integrity impact: High; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 1.27% (percentile 70, 2026-11-26)
- **CWE:** CWE-22
- **Aliases:** GHSA-5955-9wpr-37jh
- **Published:** 2021-08-31T16:05:05.000Z
- **Modified:** 2026-07-08T06:28:41.552Z

## Who should check

- Projects that depend on npm package tar (\< 4.4.18)
- Anyone running npm node-tar \< 4.4.18; \>= 5.0.0, \< 5.0.10; \>= 6.0.0, \< 6.1.9

## Description

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.

## Affected and fixed versions

- npm `tar`: affected \< 4.4.18; fixed 4.4.18, 5.0.10, 6.1.9 (osv)
- npm node-tar: \< 4.4.18; \>= 5.0.0, \< 5.0.10; \>= 6.0.0, \< 6.1.9 (cvelist)

## Mitigation

- Upgrade tar to one of 4.4.18, 5.0.10, 6.1.9 (or later in the same release line).

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2021-37713. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-37713.md
Affected: tar < 4.4.18
Fixed in: 4.4.18, 5.0.10, 6.1.9

Steps:
1. Search this machine and project for tar (npm), npm node-tar: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2021-37713 being exploited?

There is no confirmed exploitation: CVE-2021-37713 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 1.27% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2021-37713?

High: CVSS 8.2 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). A user has to take an action, such as opening a link, for the attack to work.

### Which versions are affected by CVE-2021-37713?

tar \< 4.4.18.

### Is there a fix for CVE-2021-37713?

Yes. Fixed in 4.4.18, 5.0.10, 6.1.9. Upgrade tar to one of 4.4.18, 5.0.10, 6.1.9 (or later in the same release line).

### How do I check if I'm affected by CVE-2021-37713?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/npm/node-tar/security/advisories/GHSA-5955-9wpr-37jh>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2021-37713>
- patch: <https://www.oracle.com/security-alerts/cpuoct2021.html>
- patch: <https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf>
- patch: <https://github.com/isaacs/node-tar/commit/52b09e309bcae0c741a7eb79a17ef36e7828b946>
- patch: <https://github.com/isaacs/node-tar/commit/82eac952f7c10765969ed464e549375854b26edc>
- patch: <https://github.com/isaacs/node-tar/commit/875a37e3ec031186fc6599f6807341f56c584598>
- other: <https://www.npmjs.com/package/tar>
- other: <https://github.com/npm/node-tar>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-37713>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-5955-9wpr-37jh> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2021-37713> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-37713>
