CVE-2021-32803

Summary

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

Risk And Classification

Problem Types: CWE-59

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
Remove paths from dirCache when no longer dirs · npm/node-tar@9dbdeb6 · GitHub MISC github.com
Overview MISC www.npmjs.com
Oracle Critical Patch Update Advisory - October 2021 MISC www.oracle.com
Arbitrary File Creation/Overwrite via insufficient symlink protection due to directory cache poisoning · Advisory · npm/node-tar · GitHub CONFIRM github.com
cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf CONFIRM cert-portal.siemens.com
tar - npm MISC www.npmjs.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)
  • 180594 Debian Security Update for node-tar (CVE-2021-32803)
  • 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)
  • 980365 Nodejs (npm) Security Update for tar (GHSA-r628-mhmh-qjhw)
© 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