CVE-2021-37712
Summary
| CVE | CVE-2021-37712 |
|---|---|
| State | PUBLIC |
| Assigner | [email protected] |
| Source Priority | CVE Program / NVD first with legacy fallback |
| Published | 2021-08-31 17:15:00 UTC |
| Updated | 2023-02-23 02:28:00 UTC |
| Description | The npm package "tar" (aka node-tar) before versions 4.4.18, 5.0.10, and 6.1.9 has an arbitrary file creation/overwrite and arbitrary code execution vulnerability. 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 names containing unicode values that normalized to the same value. Additionally, on Windows systems, long path portions would resolve to the same file system entities as their 8.3 "short path" counterparts. A specially crafted tar archive could thus include a directory with one form of the path, followed by a symbolic link with a different string that resolves to the same file system entity, followed by a file using the first form. By first creating a directory, and then replacing that directory with a symlink that had a different apparent name that resolved to the same entry in the filesystem, 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. These issues were addressed in releases 4.4.18, 5.0.10 and 6.1.9. The v3 branch of node-tar has been deprecated and did not receive patches for these issues. If you are still using a v3 release we recommend you update to a more recent version of node-tar. If this is not possible, a workaround is available in the referenced GHSA-qq89-hq3f-393p. |
Risk And Classification
Problem Types: CWE-22 | CWE-59
NVD Known Affected Configurations (CPE 2.3)
| Type | Vendor | Product | Version | Update | Edition | Language |
|---|---|---|---|---|---|---|
| Operating System | Debian | Debian Linux | 10.0 | All | All | All |
| Operating System | Debian | Debian Linux | 11.0 | All | All | All |
| Operating System | Microsoft | Windows | - | All | All | All |
| Application | Npmjs | Tar | All | All | All | All |
| Application | Npmjs | Tar | All | All | All | All |
| Application | Npmjs | Tar | All | All | All | All |
| 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 |
References
| Reference | Source | Link | Tags |
|---|---|---|---|
| [SECURITY] [DLA 3237-1] node-tar security update | MLIST | lists.debian.org | |
| Debian -- Security Information -- DSA-5008-1 node-tar | DEBIAN | www.debian.org | |
| Oracle Critical Patch Update Advisory - October 2021 | MISC | www.oracle.com | |
| Arbitrary File Creation/Overwrite via insufficient symlink protection due to directory cache poisoning using symbolic links · 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
- 159622 Oracle Enterprise Linux Security Update for nodejs:14 (ELSA-2022-0350)
- 178894 Debian Security Update for node-tar (DSA 5008-1)
- 181317 Debian Security Update for node-tar (DLA 3237-1)
- 182740 Debian Security Update for node-tar (CVE-2021-37712)
- 239986 Red Hat Update for rh-nodejs14-nodejs and rh-nodejs14-nodejs-nodemon (RHSA-2022:0041)
- 240037 Red Hat Update for nodejs:14 security (RHSA-2022:0246)
- 240051 Red Hat Update for nodejs:14 security (RHSA-2022:0350)
- 240414 Red Hat Update for rh-nodejs12-nodejs security (RHSA-2022:4914)
- 296065 Oracle Solaris 11.4 Support Repository Update (SRU) 39.107.1 Missing (CPUOCT2021)
- 375828 Node.js Multiple Vulnerabilities (August 2021)
- 377422 Alibaba Cloud Linux Security Update for nodejs:14 (ALINUX3-SA-2022:0014)
- 500445 Alpine Linux Security Update for nodejs
- 501454 Alpine Linux Security Update for nodejs
- 504208 Alpine Linux Security Update for nodejs
- 690030 Free Berkeley Software Distribution (FreeBSD) Security Update for node.js (7062bce0-1b17-11ec-9d9d-0022489ad614)
- 751457 OpenSUSE Security Update for nodejs12 (openSUSE-SU-2021:3940-1)
- 751475 OpenSUSE Security Update for nodejs14 (openSUSE-SU-2021:3964-1)
- 751509 OpenSUSE Security Update for nodejs12 (openSUSE-SU-2021:1574-1)
- 751518 OpenSUSE Security Update for nodejs14 (openSUSE-SU-2021:1552-1)
- 940448 AlmaLinux Security Update for nodejs:14 (ALSA-2022:0350)
- 960863 Rocky Linux Security Update for nodejs:14 (RLSA-2022:0350)
- 980152 Nodejs (npm) Security Update for tar (GHSA-qq89-hq3f-393p)