CVE-2021-32804

Summary

CVECVE-2021-32804
StatePUBLIC
Assigner[email protected]
Source PriorityCVE Program / NVD first with legacy fallback
Published2021-08-03 19:15:00 UTC
Updated2022-04-25 19:12:00 UTC
DescriptionThe 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.

Risk And Classification

Problem Types: CWE-22

NVD Known Affected Configurations (CPE 2.3)

TypeVendorProductVersionUpdateEditionLanguage
Application Oracle Graalvm 20.3.3 All All All
Application Oracle Graalvm 21.2.0 All All All
Application Siemens Sinec Infrastructure Network Services All All All All
Application Tar Project Tar All All All All

References

ReferenceSourceLinkTags
Arbitrary File Creation/Overwrite due to insufficient absolute path sanitization · Advisory · npm/node-tar · GitHub CONFIRM github.com
Oracle Critical Patch Update Advisory - October 2021 MISC www.oracle.com
cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf CONFIRM cert-portal.siemens.com
tar - npm MISC www.npmjs.com
Overview MISC www.npmjs.com
fix: strip absolute paths more comprehensively · npm/node-tar@1f036ca · GitHub MISC github.com
CVE Program record CVE.ORG www.cve.org canonical
NVD vulnerability detail NVD nvd.nist.gov canonical, analysis

Legacy QID Mappings

  • 159398 Oracle Enterprise Linux Security Update for nodejs:12 (ELSA-2021-3623)
  • 159408 Oracle Enterprise Linux Security Update for nodejs:14 (ELSA-2021-3666)
  • 179528 Debian Security Update for node-tar (CVE-2021-32804)
  • 239590 Red Hat Update for rh-nodejs12-nodejs and rh-nodejs12-nodejs-nodemon (RHSA-2021:3281)
  • 239591 Red Hat Update for rh-nodejs14-nodejs and rh-nodejs14-nodejs-nodemon (RHSA-2021:3280)
  • 239645 Red Hat Update for nodejs:12 (RHSA-2021:3623)
  • 239654 Red Hat Update for nodejs:12 (RHSA-2021:3639)
  • 239655 Red Hat Update for nodejs:12 (RHSA-2021:3638)
  • 239658 Red Hat Update for nodejs:14 (RHSA-2021:3666)
  • 375828 Node.js Multiple Vulnerabilities (August 2021)
  • 376114 IBM Integration Bus Node.js Vulnerability (6515532,6516066)
  • 377157 Alibaba Cloud Linux Security Update for nodejs:14 (ALINUX3-SA-2021:0072)
  • 690030 Free Berkeley Software Distribution (FreeBSD) Security Update for node.js (7062bce0-1b17-11ec-9d9d-0022489ad614)
  • 751759 SUSE Enterprise Linux Security Update for nodejs8 (SUSE-SU-2022:0563-1)
  • 751773 SUSE Enterprise Linux Security Update for nodejs12 (SUSE-SU-2022:0657-1)
  • 751781 OpenSUSE Security Update for nodejs12 (openSUSE-SU-2022:0657-1)
  • 751783 SUSE Enterprise Linux Security Update for nodejs8 (SUSE-SU-2022:0704-1)
  • 751801 SUSE Enterprise Linux Security Update for nodejs14 (SUSE-SU-2022:0715-1)
  • 751820 OpenSUSE Security Update for nodejs14 (openSUSE-SU-2022:0715-1)
  • 751824 OpenSUSE Security Update for nodejs8 (openSUSE-SU-2022:0704-1)
  • 751826 OpenSUSE Security Update for nodejs8 (openSUSE-SU-22022:20000-2)
  • 752142 SUSE Enterprise Linux Security Update for nodejs10 (SUSE-SU-2022:1717-1)
  • 91839 IBM Integration Bus Node.js Vulnerability (6515532,6516066)
  • 940217 AlmaLinux Security Update for nodejs:12 (ALSA-2021:3623)
  • 940388 AlmaLinux Security Update for nodejs:14 (ALSA-2021:3666)
  • 980366 Nodejs (npm) Security Update for tar (GHSA-3jfq-g458-7qm9)
© CVE.report 2026 |

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

CVE.report and Source URL Uptime Status status.cve.report