Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2021-37712

HIGH 8.2EPSS 80%

Arbitrary File Creation/Overwrite via insufficient symlink protection due to directory cache poisoning using symbolic links

Also known as GHSA-qq89-hq3f-393p

Mitigation

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

Who should check

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

Vulnerability facts

Affected
tar >= 3.0.0, < 4.4.18
Fixed in
4.4.18, 5.0.10, 6.1.9
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Not remotely exploitable (local or adjacent access needed)
CVSS
8.2 (v3.1, CNA)CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:NOpen in CVSS calculator
Show all 8 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
EPSS
1.86% chance of exploitation in 30 days (percentile 80, 2026-11-26)
CWE
CWE-22, CWE-59
Published
Modified

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.

Affected and fixed versions

Package / productAffectedFixedSource
npm tar>= 3.0.0, < 4.4.184.4.18, 5.0.10, 6.1.9osv
npm node-tar< 4.4.18; >= 5.0.0, < 5.0.10; >= 6.0.0, < 6.1.9—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

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

Details: https://flawdb.com/CVE-2021-37712.md
Affected: tar >= 3.0.0, < 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.

References

FAQ

Is CVE-2021-37712 being exploited?

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

How serious is CVE-2021-37712?

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-37712?

tar >= 3.0.0, < 4.4.18.

Is there a fix for CVE-2021-37712?

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-37712?

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.

Sponsors