VDB

CVE-2021-32804

CVE-2021-32804 PUBLISHED

The npm package "tar" (aka node-tar) before versions 6.1.1, 5.0.6, 4.4.14, and 3.3.2 has a arbitrary File Creation/Overwrite vulnerability due to insufficient absolute path sanitization. node-tar aims to prevent extraction of absolute file paths by turning absolute paths into relative paths when the `preservePaths` flag is not set to `true`. This is achieved by stripping the absolute path root from any absolute file paths contained in a tar file. For example `/home/user/.bashrc` would turn into `home/user/.bashrc`. This logic was insufficient when file paths contained repeated path roots such as `////home/user/.bashrc`. `node-tar` would only strip a single path root from such paths. When given an absolute file path with repeating path roots, the resulting path (e.g. `///home/user/.bashrc`) would still resolve to an absolute path, thus allowing arbitrary file creation and overwrite. This issue was addressed in releases 3.2.2, 4.4.14, 5.0.6 and 6.1.1. Users may work around this vulnerability without upgrading by creating a custom `onentry` method which sanitizes the `entry.path` or a `filter` method which removes entries with absolute paths. See referenced GitHub Advisory for details. Be aware of CVE-2021-32803 which fixes a similar bug in later versions of tar.

EPSS 84.98% · 99.4th percentile

Risk Scores

EPSS Score
84.98%
99.4th percentile

Affected Products

VendorProductVersions
Ubuntu:24.04:LTSnode-tar*, 6.1.13+~cs7.0.5-1, 0
Ubuntu:22.04:LTSnode-tar6.1.11+ds1+~cs6.0.6-1, 6.1.7+~cs11.3.10-1, 0
Ubuntu:25.10node-tar*, 0
Ubuntu:Pro:20.04:LTSnode-tar4.4.10+ds1-2, 0, 4.4.10+ds1-2ubuntu1
Ubuntu:Pro:14.04:LTSnode-tar0.1.18-1, 0.1.18-1ubuntu0.1~esm1, 0
Ubuntu:Pro:16.04:LTSnode-tar0, 1.0.3-2, 1.0.3-2ubuntu0.1~esm1
Ubuntu:18.04:LTSnode-tar0, 2.2.1-1

Exploit Intelligence

…and 60 more exploits

Timeline

  • Aug 3, 2021 CVE Published
  • Aug 4, 2021 EPSS Score
  • Oct 2, 2021 EPSS Score
  • Oct 21, 2021 CVE Updated
  • Jan 6, 2022 EPSS Score
  • Jan 28, 2022 EPSS Score
  • Mar 28, 2022 EPSS Score
  • Apr 1, 2022 EPSS Score
  • Apr 7, 2022 PoC Published
  • May 26, 2022 EPSS Score
  • Sep 22, 2022 EPSS Score
  • Nov 19, 2022 EPSS Score
Open in Interactive Console →
$ Console Community · 100/wk Open console ›