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-32803

HIGH 8.2EPSS 95%

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

Also known as GHSA-r628-mhmh-qjhw

Mitigation

  • Upgrade tar to one of 3.2.3, 4.4.15, 5.0.7, 6.1.2 (or later in the same release line).

Who should check

  • Projects that depend on npm package tar (>= 3.0.0, < 3.2.3)
  • Anyone running npm node-tar < 3.2.3; >= 4.0.0, < 4.4.15; >= 5.0.0, < 5.0.7; >= 6.0.0, < 6.1.2

Vulnerability facts

Affected
tar >= 3.0.0, < 3.2.3
Fixed in
3.2.3, 4.4.15, 5.0.7, 6.1.2
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
7.10% chance of exploitation in 30 days (percentile 95, 2026-11-26)
CWE
CWE-22
Published
Modified

Description

The npm package "tar" (aka node-tar) before versions 6.1.2, 5.0.7, 4.4.15, and 3.2.3 has an arbitrary File Creation/Overwrite vulnerability via insufficient symlink protection. `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 the same name as the directory. This order of operations resulted in the directory being created and added to the `node-tar` directory cache. When a directory is present in the directory cache, subsequent calls to mkdir for that directory are skipped. However, this is also where `node-tar` checks for symlinks occur. By first creating a directory, and then replacing that directory with a symlink, 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. This issue was addressed in releases 3.2.3, 4.4.15, 5.0.7 and 6.1.2.

Affected and fixed versions

Package / productAffectedFixedSource
npm tar>= 3.0.0, < 3.2.33.2.3, 4.4.15, 5.0.7, 6.1.2osv
npm node-tar< 3.2.3; >= 4.0.0, < 4.4.15; >= 5.0.0, < 5.0.7; >= 6.0.0, < 6.1.2—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-32803. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-32803.md
Affected: tar >= 3.0.0, < 3.2.3
Fixed in: 3.2.3, 4.4.15, 5.0.7, 6.1.2

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-32803 being exploited?

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

How serious is CVE-2021-32803?

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

tar >= 3.0.0, < 3.2.3.

Is there a fix for CVE-2021-32803?

Yes. Fixed in 3.2.3, 4.4.15, 5.0.7, 6.1.2. Upgrade tar to one of 3.2.3, 4.4.15, 5.0.7, 6.1.2 (or later in the same release line).

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

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