cve.bz

CVE-2021-32804 Path traversal

8.1 highEPSS 15%Fix available

High (8.1). EPSS 15% estimated probability of exploitation activity in the next 30 days. Fixed in tar 3.2.2, 4.4.14, 5.0.6.

On this page
The 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.

Severity

CVSS 3.1

8.1 high
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H
EPSS
15% (unchanged from 15% a week ago; 15% 30 days ago) estimated probability of exploitation activity in the next 30 days; 97th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-22 Improper Limitation of a Pathname to a Restricted Directory (Path traversal)
OWASP Top 10
A01:2025 Broken Access Control
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-32804 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-32804?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-32804?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-32804 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
tar_project:tarbefore 3.2.2
tar_project:tarfrom 4.0.0 before 4.4.14
tar_project:tarfrom 5.0.0 before 5.0.6
tar_project:tarfrom 6.0.0 before 6.1.1
oracle:graalvm20.3.3
oracle:graalvm21.2.0
siemens:sinec_infrastructure_network_servicesbefore 1.0.1.1

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-3jfq-g458-7qm9npmtar<3.2.23.2.2
GHSA-3jfq-g458-7qm9npmtar>=4.0.0 <4.4.144.4.14
GHSA-3jfq-g458-7qm9npmtar>=5.0.0 <5.0.65.0.6
GHSA-3jfq-g458-7qm9npmtar>=6.0.0 <6.1.16.1.1

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12, 13, 14node-tar6.1.7+~cs11.3.10-1DEBIAN-CVE-2021-32804
Ubuntu18.04:LTS, 22.04:LTS, 24.04:LTS and 6 morenode-tarno fix listedUBUNTU-CVE-2021-32804
Red Hatenterprise_linux:8::appstreamnodejs, nodejs-docs, nodejs-devel and 3 more1:12.22.5-1.module+el8.4.0+12242+af52a4c7RHSA-2021:3623
Red Hatenterprise_linux:8::appstreamnodejs, nodejs-docs, nodejs-devel and 3 more1:14.17.5-1.module+el8.4.0+12247+e2879e58RHSA-2021:3666
Red Hatenterprise_linux:8::appstreamnodejs-nodemon0:2.0.3-1.module+el8.3.0+6519+9f98ed83RHSA-2021:3666
Red Hatenterprise_linux:8::appstreamnodejs-nodemon0:2.0.3-1.module+el8.4.0+11732+c668cc9fRHSA-2021:3623
Red Hatenterprise_linux:8::appstreamnodejs-packaging0:17-3.module+el8.1.0+3369+37ae6a45RHSA-2021:3623
Red Hatenterprise_linux:8::appstreamnodejs-packaging0:23-3.module+el8.3.0+6519+9f98ed83RHSA-2021:3666
Red Hatenterprise_linux:8::appstreamnpm1:6.14.14-1.12.22.5.1.module+el8.4.0+12242+af52a4c7RHSA-2021:3623
Red Hatenterprise_linux:8::appstreamnpm1:6.14.14-1.14.17.5.1.module+el8.4.0+12247+e2879e58RHSA-2021:3666
Red Hatrhel_eus:8.1::appstreamnodejs, nodejs-docs, nodejs-devel and 3 more1:12.22.5-1.module+el8.1.0+12238+63fe3aecRHSA-2021:3639
Red Hatrhel_eus:8.1::appstreamnodejs-nodemon0:1.18.3-1.module+el8.1.0+3369+37ae6a45RHSA-2021:3639
Red Hatrhel_eus:8.1::appstreamnodejs-packaging0:17-3.module+el8.1.0+3369+37ae6a45RHSA-2021:3639
Red Hatrhel_eus:8.1::appstreamnpm1:6.14.14-1.12.22.5.1.module+el8.1.0+12238+63fe3aecRHSA-2021:3639
10 more for Red Hat in the JSON and on Red Hat's page.
SUSEEnterprise Storage 6, Enterprise Storage 7, Linux Enterprise High Performance Computing 15 SP1-ESPOS and 16 morenodejs-common2.0-3.4.1SUSE-SU-2022:0704-1
SUSEEnterprise Storage 6, Enterprise Storage 7, Linux Enterprise High Performance Computing 15 SP1-ESPOS and 16 morenodejs1010.24.1-150000.1.44.1SUSE-SU-2022:1717-1
SUSEEnterprise Storage 6, Linux Enterprise High Performance Computing 15 SP1-ESPOS, Linux Enterprise High Performance Computing 15 SP1-LTSS and 7 morenodejs88.17.0-3.54.2SUSE-SU-2022:0563-1
SUSEEnterprise Storage 7, Linux Enterprise High Performance Computing 15 SP2-ESPOS, Linux Enterprise High Performance Computing 15 SP2-LTSS and 7 morenodejs1212.22.10-4.29.3SUSE-SU-2022:0657-1
SUSEEnterprise Storage 7, Linux Enterprise High Performance Computing 15 SP2-ESPOS, Linux Enterprise High Performance Computing 15 SP2-LTSS and 7 morenodejs1414.19.0-15.27.1SUSE-SU-2022:0715-1
SUSEEnterprise Storage 7, Linux Enterprise High Performance Computing 15 SP2-ESPOS, Linux Enterprise High Performance Computing 15 SP2-LTSS and 6 morenodejs88.17.0-10.19.2SUSE-SU-2022:0704-1
SUSELinux Enterprise Module for Web and Scripting 12nodejs1010.24.1-1.46.1SUSE-SU-2022:0570-1
SUSELinux Enterprise Module for Web and Scripting 12nodejs1212.22.10-1.42.2SUSE-SU-2022:0531-1
SUSELinux Enterprise Module for Web and Scripting 12nodejs1414.19.0-6.24.1SUSE-SU-2022:0569-1
openSUSELeap 15.3nodejs1212.22.10-4.29.3openSUSE-SU-2022:0657-1
openSUSELeap 15.3nodejs1414.19.0-15.27.1openSUSE-SU-2022:0715-1
openSUSELeap 15.3nodejs88.17.0-10.19.2openSUSE-SU-2022:0704-1
openSUSELeap 15.3, Leap 15.4nodejs1010.24.1-150000.1.44.1SUSE-SU-2022:1717-1
AlmaLinux8nodejs, nodejs-devel, nodejs-full-i18n1:12.22.5-1.module_el8.5.0+85+79a7b441ALSA-2021:3623
AlmaLinux8nodejs, nodejs-docs, nodejs-devel and 1 more1:12.22.5-1.module_el8.4.0+2529+af52a4c7ALSA-2021:3623
AlmaLinux8nodejs-nodemon2.0.3-1.module_el8.4.0+2521+c668cc9fALSA-2021:3623 ALSA-2021:3666
AlmaLinux8nodejs-packaging17-3.module_el8.3.0+2023+d2377ea3ALSA-2021:3623
AlmaLinux8nodejs-packaging17-3.module_el8.4.0+2224+b07ac28eALSA-2021:3623
AlmaLinux8nodejs-packaging17-3.module_el8.4.0+2521+c668cc9fALSA-2021:3623
AlmaLinux8nodejs-packaging23-3.module_el8.4.0+2522+3bd42762ALSA-2021:3666
AlmaLinux8nodejs-packaging23-3.module_el8.5.0+254+b4526b16ALSA-2021:3666
AlmaLinux8npm1:6.14.14-1.12.22.5.1.module_el8.4.0+2529+af52a4c7ALSA-2021:3623
AlmaLinux8npm1:6.14.14-1.12.22.5.1.module_el8.5.0+85+79a7b441ALSA-2021:3623
Rocky Linux8nodejs1:12.22.5-1.module+el8.4.0+647+e905fa21RLSA-2021:3623
Rocky Linux8nodejs1:14.17.5-1.module+el8.4.0+654+17ff1d38RLSA-2021:3666
Rocky Linux8nodejs-nodemon0:2.0.3-1.module+el8.3.0+100+234774f7RLSA-2021:3623 RLSA-2021:3666
Rocky Linux8nodejs-nodemon0:2.0.3-1.module+el8.4.0+638+5344c6f7RLSA-2021:3623 RLSA-2021:3666
Rocky Linux8nodejs-nodemon0:2.0.3-1.module+el8.6.0+982+9fdca2d4RLSA-2021:3623 RLSA-2021:3666
Rocky Linux8nodejs-packaging0:17-3.module+el8.3.0+101+f84c7154RLSA-2021:3623
Rocky Linux8nodejs-packaging0:23-3.module+el8.3.0+100+234774f7RLSA-2021:3666
Rocky Linux8nodejs-packaging0:23-3.module+el8.5.0+733+de4fee6cRLSA-2021:3666
Rocky Linux8nodejs-packaging0:23-3.module+el8.7.0+1071+4bdda2a8RLSA-2021:3666

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

Red Hat Quay 3.3 uses an affected version of nodejs-tar. However Quay 3.3 is in extended life phase and a fix will not be delivered[1]. More recent versions of Red Hat Quay do not include nodejs-tar and are not affected.

1. https://access.redhat.com/support/policy/updates/rhquay

Red Hat Enterprise Linux version 8 and Red Hat Software Collection both embed node-tar in the npm command. A specially crafted node module could create and overwrite files outside of its dedicated directory.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 8nodejs:12-8040020210817133458.522a0ee4Fixed 2021-09-21RHSA-2021:3623
Red Hat Enterprise Linux 8nodejs:14-8040020210817165654.522a0ee4Fixed 2021-09-27RHSA-2021:3666
Red Hat Enterprise Linux 8.1 Extended Update Supportnodejs:12-8010020210817113128.c27ad7f8Fixed 2021-09-22RHSA-2021:3639
Red Hat Enterprise Linux 8.2 Extended Update Supportnodejs:12-8020020210817125332.4cda2c84Fixed 2021-09-22RHSA-2021:3638
Red Hat OpenShift Data Foundation 4.9.0 on RHEL-8odf4/cephcsi-rhel8:4.9-164.57484e3.release_4.9Fixed 2021-12-13RHSA-2021:5086
Red Hat OpenShift Data Foundation 4.9.0 on RHEL-8odf4/ocs-must-gather-rhel8:4.9-257.4181add.release_4.9Fixed 2021-12-13RHSA-2021:5086
Red Hat OpenShift Data Foundation 4.9.0 on RHEL-8odf4/ocs-operator-bundle:4.9.0-5Fixed 2021-12-13RHSA-2021:5086
Red Hat OpenShift Data Foundation 4.9.0 on RHEL-8odf4/ocs-rhel8-operator:4.9-257.4181add.release_4.9Fixed 2021-12-13RHSA-2021:5086
Red Hat OpenShift Data Foundation 4.9.0 on RHEL-8odf4/odf-console-rhel8:4.9-39.0f2fa23.release_4.9Fixed 2021-12-13RHSA-2021:5086
Red Hat OpenShift Data Foundation 4.9.0 on RHEL-8odf4/odf-multicluster-operator-bundle:4.9.0-5Fixed 2021-12-13RHSA-2021:5086
OpenShift Service Mesh 2.0servicemesh-grafanaAffected
OpenShift Service Mesh 2.0servicemesh-prometheusAffected
Red Hat Advanced Cluster Management for Kubernetes 2rhacm2/application-ui-rhel8Not affected
Red Hat Advanced Cluster Management for Kubernetes 2rhacm2/console-header-rhel8Fix deferred
Red Hat Advanced Cluster Management for Kubernetes 2rhacm2/console-rhel8Fix deferred
Red Hat Advanced Cluster Management for Kubernetes 2rhacm2/console-ui-rhel8Fix deferred
Red Hat Advanced Cluster Management for Kubernetes 2rhacm2/grc-ui-rhel8Affected
Red Hat Advanced Cluster Management for Kubernetes 2rhacm2/kui-web-terminal-rhel8Fix deferred
Red Hat Advanced Cluster Management for Kubernetes 2rhacm2/mcm-topology-rhel8Fix deferred
Red Hat Advanced Cluster Management for Kubernetes 2rhacm2/search-ui-rhel8Affected
22 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2021-32804.

ICS advisories (CISA)

AdvisoryTitlePublishedSectorsAffectedFixed
ICSA-22-069-09Siemens SINEC INS2022-03-08MultipleSINEC INSnone listed

From CISA's ICS advisories (CSAF), provided under CISA's notification. Only the facts are shown; each advisory is on CISA's page. Credits.

Attack patterns (CAPEC)

  • CAPEC-64 Using Slashes and URL Encoding Combined to Bypass Validation Logic Likelihood: High · Severity: High
  • CAPEC-76 Manipulating Web Input to File System Calls Likelihood: High · Severity: Very High
  • CAPEC-78 Using Escaped Slashes in Alternate Encoding Likelihood: High · Severity: High
  • CAPEC-79 Using Slashes in Alternate Encoding Likelihood: High · Severity: High
  • CAPEC-126 Path Traversal Likelihood: High · Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON