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

- Severity: High 8.2 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.86%, higher than 79% of CVEs (2026-12-01)
- Published: 2021-08-31T00:00:00.000Z
- Modified: 2026-07-08T06:28:24.989Z
- Also known as: GHSA-qq89-hq3f-393p
- Weaknesses: CWE-22, CWE-59
- Assigned by: GitHub_M

## 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 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 names containing unicode values that normalized to the same value. Additionally, on Windows systems, long path portions would resolve to the same file system entities as their 8.3 "short path" counterparts. A specially crafted tar archive could thus include a directory with one form of the path, followed by a symbolic link with a different string that resolves to the same file system entity, followed by a file using the first form. By first creating a directory, and then replacing that directory with a symlink that had a different apparent name that resolved to the same entry in the filesystem, 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. 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. If this is not possible, a workaround is available in the referenced GHSA-qq89-hq3f-393p.

(As written by CVE List.)

## Affected

- npm node-tar: < 4.4.18; >= 5.0.0, < 5.0.10; >= 6.0.0, < 6.1.9
- tar (npm): from 3.0.0 before 4.4.18; from 5.0.0 before 5.0.10; from 6.0.0 before 6.1.9
- npmjs tar: up to 4.4.17; from 5.0.0 up to 5.0.9; from 6.0.0 up to 6.1.8
- debian debian_linux: 10.0; 11.0
- oracle graalvm: 20.3.3; 21.2.0
- siemens sinec_infrastructure_network_services: before 1.0.1.1

## Every score

- GitHub_M: CVSS:3.1 8.2 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N`
- GitHub: CVSS:3.1 8.2 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N`
- NVD: CVSS:3.1 8.6 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H`
- NVD: CVSS:2.0 4.4 Medium `AV:L/AC:M/Au:N/C:P/I:P/A:P`

## References

- <https://www.npmjs.com/package/tar> (product, web)
- <https://github.com/npm/node-tar/security/advisories/GHSA-qq89-hq3f-393p> (patch, third-party-advisory, web)
- <https://www.oracle.com/security-alerts/cpuoct2021.html> (patch, third-party-advisory, web)
- <https://www.debian.org/security/2021/dsa-5008> (third-party-advisory, vendor-advisory, web)
- <https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf> (patch, third-party-advisory, web)
- <https://lists.debian.org/debian-lts-announce/2022/12/msg00023.html> (mailing-list, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-37712> (advisory)
- <https://github.com/isaacs/node-tar/commit/1739408d3122af897caefd09662bce2ea477533b> (web)
- <https://github.com/isaacs/node-tar/commit/2f1bca027286c23e110b8dfc7efc10756fa3db5a> (web)
- <https://github.com/isaacs/node-tar/commit/3aaf19b2501bbddb145d92b3322c80dcaed3c35f> (web)
- <https://github.com/isaacs/node-tar/commit/b6162c7fafe797f856564ef37f4b82747f051455> (web)
- <https://github.com/isaacs/node-tar/commit/bb93ba243746f705092905da1955ac3b0509ba1e> (web)
- <https://github.com/isaacs/node-tar/commit/d56f790bda9fea807dd80c5083f24771dbdd6eb1> (web)
- <https://github.com/npm/node-tar> (package)

## Sources

- CVE List: [CVE-2021-37712](https://www.cve.org/CVERecord?id=CVE-2021-37712), CVE Terms of Use, modified 2024-08-04
- GitHub Advisory Database: [GHSA-qq89-hq3f-393p](https://github.com/advisories/GHSA-qq89-hq3f-393p), CC-BY-4.0, modified 2026-07-08
- NVD: [CVE-2021-37712](https://nvd.nist.gov/vuln/detail/CVE-2021-37712), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-37712 · Whole record: https://cve.day/CVE-2021-37712.json · Rebuilt by cve.day 2026-11-25T22:58:03.581Z
