Arbitrary File Creation/Overwrite via insufficient symlink protection due to directory cache poisoning
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- High · High · None
- Fix status
- Partial Red Hat: 7 fixed, 5 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat.
Summary
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| npm | node-tar | before 3.2.3; 4.0.0 to before 4.4.15; 5.0.0 to before 5.0.7; 6.0.0 to before 6.1.2 | 3.2.3, 4.4.15, 5.0.7, 6.1.2 | Patch available | CNA |
| — | tar (npm) | 3.0.0 to before 3.2.3 | 3.2.3 | Patch available | GHSA-r628-mhmh-qjhw |
| — | tar (npm) | 4.0.0 to before 4.4.15 | 4.4.15 | Patch available | GHSA-r628-mhmh-qjhw |
| — | tar (npm) | 5.0.0 to before 5.0.7 | 5.0.7 | Patch available | GHSA-r628-mhmh-qjhw |
| — | tar (npm) | 6.0.0 to before 6.1.2 | 6.1.2 | Patch available | GHSA-r628-mhmh-qjhw |
- node-tar Vendornpm Affected before 3.2.3; 4.0.0 to before 4.4.15; 5.0.0 to before 5.0.7; 6.0.0 to before 6.1.2 Fixed in 3.2.3, 4.4.15, 5.0.7, 6.1.2 Patch available CNA
- tar (npm) Vendor— Affected 3.0.0 to before 3.2.3 Fixed in 3.2.3 Patch available GHSA-r628-mhmh-qjhw
- tar (npm) Vendor— Affected 4.0.0 to before 4.4.15 Fixed in 4.4.15 Patch available GHSA-r628-mhmh-qjhw
- tar (npm) Vendor— Affected 5.0.0 to before 5.0.7 Fixed in 5.0.7 Patch available GHSA-r628-mhmh-qjhw
- tar (npm) Vendor— Affected 6.0.0 to before 6.1.2 Fixed in 6.1.2 Patch available GHSA-r628-mhmh-qjhw
CPE configurations NVD · 4
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:* | before 3.2.3; 4.0.0 to before 4.4.15; 5.0.0 to before 5.0.7; 6.0.0 to before 6.1.2 | Vulnerable | Tar Project |
| cpe:2.3:a:oracle:graalvm:20.3.3:*:*:*:enterprise:*:*:* | 20.3.3 | Vulnerable | Oracle |
| cpe:2.3:a:oracle:graalvm:21.2.0:*:*:*:enterprise:*:*:* | 21.2.0 | Vulnerable | Oracle |
| cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:* | before 1.0.1.1 | Vulnerable | Siemens |
- cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:* Versions before 3.2.3; 4.0.0 to before 4.4.15; 5.0.0 to before 5.0.7; 6.0.0 to before 6.1.2 Vulnerable ·Tar Project
- cpe:2.3:a:oracle:graalvm:20.3.3:*:*:*:enterprise:*:*:* Versions 20.3.3 Vulnerable ·Oracle
- cpe:2.3:a:oracle:graalvm:21.2.0:*:*:*:enterprise:*:*:* Versions 21.2.0 Vulnerable ·Oracle
- cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:* Versions before 1.0.1.1 Vulnerable ·Siemens
Remediation
- Fix · CNA node-tar (npm) Fixed in 3.2.3, 4.4.15, 5.0.7, 6.1.2
- Fix · GHSA-r628-mhmh-qjhw tar (npm) Fixed in 3.2.3 Advisory →
- Fix · GHSA-r628-mhmh-qjhw tar (npm) Fixed in 4.4.15 Advisory →
- Fix · GHSA-r628-mhmh-qjhw tar (npm) Fixed in 5.0.7 Advisory →
- Fix · GHSA-r628-mhmh-qjhw tar (npm) Fixed in 6.1.2 Advisory →
Red Hat 8 advisories
- RHSA-2021:5086 Released 2021-12-13 · Red Hat rating ModerateRed Hat OpenShift Data Foundation 4.9.0 enhancement, security, and bug fix update
- Red Hat OpenShift Data Foundation 4.9 on RHEL-8 odf/odf-multicluster-rhel8-operator, odf4/cephcsi-rhel8, odf4/ocs-must-gather-rhel8 +12
- RHSA-2021:4618 Released 2021-11-11 · Red Hat rating ImportantRed Hat Advanced Cluster Management 2.4 images and security updates
- Red Hat Advanced Cluster Management for Kubernetes 2.4 for RHEL 8 rhacm2/acm-grafana-rhel8, rhacm2/acm-must-gather-rhel8, rhacm2/acm-operator-bundle +47
- RHSA-2021:3666 Released 2021-09-27 · Red Hat rating Importantnodejs:14 security and bug fix update
- Red Hat Enterprise Linux AppStream (v. 8) nodejs-1:14.17.5-1.module+el8.4.0+12247+e2879e58.aarch64::nodejs:14, nodejs-1:14.17.5-1.module+el8.4.0+12247+e2879e58.ppc64le::nodejs:14, nodejs-1:14.17.5-1.module+el8.4.0+12247+e2879e58.s390x::nodejs:14 +19
Show 5 more Red Hat advisories
- RHSA-2021:3638 Released 2021-09-22 · Red Hat rating Importantnodejs:12 security and bug fix update
- Red Hat Enterprise Linux AppStream EUS (v. 8.2) nodejs-1:12.22.5-1.module+el8.2.0+12241+a3db445b.aarch64::nodejs:12, nodejs-1:12.22.5-1.module+el8.2.0+12241+a3db445b.ppc64le::nodejs:12, nodejs-1:12.22.5-1.module+el8.2.0+12241+a3db445b.s390x::nodejs:12 +19
- RHSA-2021:3639 Released 2021-09-22 · Red Hat rating Importantnodejs:12 security and bug fix update
- Red Hat Enterprise Linux AppStream EUS (v. 8.1) nodejs-1:12.22.5-1.module+el8.1.0+12238+63fe3aec.aarch64::nodejs:12, nodejs-1:12.22.5-1.module+el8.1.0+12238+63fe3aec.ppc64le::nodejs:12, nodejs-1:12.22.5-1.module+el8.1.0+12238+63fe3aec.s390x::nodejs:12 +19
- RHSA-2021:3623 Released 2021-09-21 · Red Hat rating Importantnodejs:12 security and bug fix update
- Red Hat Enterprise Linux AppStream (v. 8) nodejs-1:12.22.5-1.module+el8.4.0+12242+af52a4c7.aarch64::nodejs:12, nodejs-1:12.22.5-1.module+el8.4.0+12242+af52a4c7.ppc64le::nodejs:12, nodejs-1:12.22.5-1.module+el8.4.0+12242+af52a4c7.s390x::nodejs:12 +19
- RHSA-2021:3280 Released 2021-08-26 · Red Hat rating Importantrh-nodejs14-nodejs and rh-nodejs14-nodejs-nodemon security update
- Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 7) rh-nodejs14-nodejs-14.17.5-1.el7, rh-nodejs14-nodejs-devel-14.17.5-1.el7, rh-nodejs14-nodejs-docs-14.17.5-1.el7 +2
- Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.7) rh-nodejs14-nodejs-14.17.5-1.el7, rh-nodejs14-nodejs-devel-14.17.5-1.el7, rh-nodejs14-nodejs-docs-14.17.5-1.el7 +2
- Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7) rh-nodejs14-nodejs-14.17.5-1.el7, rh-nodejs14-nodejs-devel-14.17.5-1.el7, rh-nodejs14-nodejs-docs-14.17.5-1.el7 +2
- RHSA-2021:3281 Released 2021-08-26 · Red Hat rating Importantrh-nodejs12-nodejs and rh-nodejs12-nodejs-nodemon security update
- Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 7) rh-nodejs12-nodejs-12.22.5-1.el7, rh-nodejs12-nodejs-devel-12.22.5-1.el7, rh-nodejs12-nodejs-docs-12.22.5-1.el7 +2
- Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.7) rh-nodejs12-nodejs-12.22.5-1.el7, rh-nodejs12-nodejs-devel-12.22.5-1.el7, rh-nodejs12-nodejs-docs-12.22.5-1.el7 +2
- Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7) rh-nodejs12-nodejs-12.22.5-1.el7, rh-nodejs12-nodejs-devel-12.22.5-1.el7, rh-nodejs12-nodejs-docs-12.22.5-1.el7 +2
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| OpenShift Service Mesh 2.0 | Affected | No fix yet |
| Red Hat Advanced Cluster Management for Kubernetes 2 | Affected | No fix yet |
| Red Hat OpenShift Container Platform 4 | Affected | No fix planned: Will not fix |
| Red Hat OpenShift GitOps | Affected | No fix planned: Will not fix |
| Red Hat Openshift Container Storage 4 | Affected | No fix yet |
| Red Hat Enterprise Linux AppStream (v. 8) | Fixed | RHSA-2021:3623, RHSA-2021:3666 |
| Red Hat Enterprise Linux AppStream EUS (v. 8.1) | Fixed | RHSA-2021:3639 |
| Red Hat Enterprise Linux AppStream EUS (v. 8.2) | Fixed | RHSA-2021:3638 |
| Red Hat OpenShift Data Foundation 4.9 on RHEL-8 | Fixed | RHSA-2021:5086 |
| Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 7) | Fixed | RHSA-2021:3280, RHSA-2021:3281 |
| Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.7) | Fixed | RHSA-2021:3280, RHSA-2021:3281 |
| Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7) | Fixed | RHSA-2021:3280, RHSA-2021:3281 |
Not affected: 9 products
- Red Hat Advanced Cluster Management for Kubernetes 2
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- Red Hat Fuse 7
- Red Hat OpenShift distributed tracing 2
- Red Hat Quay 3
- Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 7)
- Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.7)
- Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7)
Timeline
- 2026-10-02 Threatist record created from CVE-2021-32803
- 2026-10-03 Alias added: GHSA-r628-mhmh-qjhw
References
Patch 3
Advisory 4
Other 5
- https://github.com/isaacs/node-tar/commit/46fe35083e2676e31c4e0a81639dce6da7aaa356
- https://github.com/isaacs/node-tar/commit/5987d9a41f6bfbf1ddab1098e1fdcf1a5618f571
- https://github.com/isaacs/node-tar/commit/85d3a942b4064e4ff171f91696fced7975167349
- https://github.com/isaacs/node-tar/commit/9dbdeb6df8e9dbd96fa9e84341b9d74734be6c20
- https://github.com/isaacs/node-tar
Sources
- CVE-2021-32803 · CVE Program
- CVE-2021-32803 · NVD
- FIRST EPSS
- GHSA-r628-mhmh-qjhw · GitHub Advisory Database · CC BY 4.0
- CVE-2021-32803 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences