CVE-2021-32803
Summary
| CVE | CVE-2021-32803 |
| State | PUBLIC |
| Assigner | [email protected] |
| Source Priority | CVE Program / NVD first with legacy fallback |
| Published | 2021-08-03 19:15:00 UTC |
| Updated | 2022-07-02 18:28:00 UTC |
| 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. |
NVD Known Affected Configurations (CPE 2.3)
References
| Reference | Source | Link | Tags |
|---|
| 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 |
No vendor comments have been submitted for this CVE.
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)