CVE-2021-32804
JavaScript vulnerability analysis and mitigation

Overview

CVE-2021-32804 is a vulnerability in node-tar affecting versions <3.2.2, 4.x <4.4.14, 5.x <5.0.6, and 6.x <6.1.1. The vulnerability stems from insufficient absolute path sanitization when the preservePaths flag is not set to true. The issue was discovered and disclosed in August 2021 (GitHub Advisory).

Technical details

The vulnerability occurs in node-tar's path sanitization logic. When attempting to prevent extraction of absolute file paths, the package strips the absolute path root from file paths in tar files. However, the logic was insufficient when handling paths with repeated path roots (e.g., ////home/user/.bashrc). The package would only strip a single path root, leaving the path still resolvable as absolute (e.g., ///home/user/.bashrc), thus enabling arbitrary file creation and overwrite (GitHub Advisory).

Impact

A successful exploit could lead to arbitrary file creation and overwrite on the target system, potentially enabling arbitrary code execution. The vulnerability allows attackers to bypass the package's path sanitization protections and write files to arbitrary locations on the filesystem (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in versions 3.2.2, 4.4.14, 5.0.6, and 6.1.1. Users should upgrade to these versions or later. As a temporary workaround, users can implement custom onentry or filter methods to sanitize entry paths or remove entries with absolute paths. However, upgrading to patched versions is strongly recommended over implementing custom sanitization (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-23744CRITICAL9.8
  • JavaScriptJavaScript
  • @mcpjam/inspector
NoYesJan 16, 2026
CVE-2026-23735HIGH8.7
  • JavaScriptJavaScript
  • graphql-modules
NoYesJan 16, 2026
GHSA-gw32-9rmw-qwwwHIGH8.4
  • JavaScriptJavaScript
  • svelte
NoYesJan 16, 2026
CVE-2026-23745HIGH8.2
  • JavaScriptJavaScript
  • nodejs-full-i18n
NoYesJan 16, 2026
GHSA-38cw-85xc-xr9xMEDIUM6.8
  • JavaScriptJavaScript
  • @veramo/data-store
NoYesJan 16, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management