cve.bz

CVE-2021-37712 Link Following

8.6 highEPSS 1.9%Fix available

High (8.6). EPSS 1.9% estimated probability of exploitation activity in the next 30 days. Fixed in tar 4.4.18, 5.0.10, 6.1.9.

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

Severity

CVSS 3.1

8.6 high
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
EPSS
1.9% (unchanged from 1.9% a week ago; 1.9% 30 days ago) estimated probability of exploitation activity in the next 30 days; 80th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWEs
CWE-59 Improper Link Resolution Before File Access (Link Following)
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-37712 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-37712?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-37712?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-37712 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
npmjs:tarthrough 4.4.17
npmjs:tarfrom 5.0.0 through 5.0.9
npmjs:tarfrom 6.0.0 through 6.1.8
debian:debian_linux10.0
debian:debian_linux11.0
oracle:graalvm20.3.3
oracle:graalvm21.2.0
siemens:sinec_infrastructure_network_servicesbefore 1.0.1.1

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-qq89-hq3f-393pnpmtar>=3.0.0 <4.4.184.4.18
GHSA-qq89-hq3f-393pnpmtar>=5.0.0 <5.0.105.0.10
GHSA-qq89-hq3f-393pnpmtar>=6.0.0 <6.1.96.1.9

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian10node-tar4.4.6+ds1-3+deb10u2DLA-3237-1
Debian11node-tar6.0.5+ds1+~cs11.3.9-1+deb11u2DSA-5008-1
Debian12, 13, 14node-tar6.1.11+~cs11.3.10-1DEBIAN-CVE-2021-37712
Ubuntu18.04:LTS, 22.04:LTS, 24.04:LTS and 6 morenode-tarno fix listedUBUNTU-CVE-2021-37712
Red Hatenterprise_linux:8::appstreamnodejs, nodejs-docs, nodejs-devel and 3 more1:12.22.12-1.module+el8.6.0+15324+1f2c5d8dRHEA-2022:5139
Red Hatenterprise_linux:8::appstreamnodejs, nodejs-docs, nodejs-devel and 3 more1:14.18.2-2.module+el8.5.0+13644+8d46dafdRHSA-2022:0350
Red Hatenterprise_linux:8::appstreamnodejs-nodemon0:2.0.15-1.module+el8.5.0+13504+a2e74d91RHSA-2022:0350
Red Hatenterprise_linux:8::appstreamnodejs-nodemon0:2.0.3-1.module+el8.4.0+11732+c668cc9fRHEA-2022:5139
Red Hatenterprise_linux:8::appstreamnodejs-packaging0:17-3.module+el8.1.0+3369+37ae6a45RHEA-2022:5139
Red Hatenterprise_linux:8::appstreamnodejs-packaging0:23-3.module+el8.3.0+6519+9f98ed83RHSA-2022:0350
Red Hatenterprise_linux:8::appstreamnpm1:6.14.15-1.14.18.2.2.module+el8.5.0+13644+8d46dafdRHSA-2022:0350
Red Hatenterprise_linux:8::appstreamnpm1:6.14.16-1.12.22.12.1.module+el8.6.0+15324+1f2c5d8dRHEA-2022:5139
Red Hatrhel_e4s:8.1::appstreamnodejs, nodejs-docs, nodejs-devel and 3 more1:12.22.12-1.module+el8.1.0+15296+87b2f6adRHEA-2022:4925
Red Hatrhel_e4s:8.1::appstreamnodejs-nodemon0:1.18.3-1.module+el8.1.0+3369+37ae6a45RHEA-2022:4925
Red Hatrhel_e4s:8.1::appstreamnodejs-packaging0:17-3.module+el8.1.0+3369+37ae6a45RHEA-2022:4925
Red Hatrhel_e4s:8.1::appstreamnpm1:6.14.16-1.12.22.12.1.module+el8.1.0+15296+87b2f6adRHEA-2022:4925
17 more for Red Hat in the JSON and on Red Hat's page.
SUSELinux Enterprise Module for Web and Scripting 12nodejs1212.22.9-1.38.1SUSE-SU-2022:0101-1
SUSELinux Enterprise Module for Web and Scripting 12nodejs1414.18.1-6.18.2SUSE-SU-2021:3886-1
SUSELinux Enterprise Module for Web and Scripting 15 SP2, Linux Enterprise Module for Web and Scripting 15 SP3nodejs1212.22.7-4.22.1SUSE-SU-2021:3940-1
SUSELinux Enterprise Module for Web and Scripting 15 SP2, Linux Enterprise Module for Web and Scripting 15 SP3nodejs1414.18.1-15.21.2SUSE-SU-2021:3964-1
openSUSELeap 15.2nodejs1212.22.7-lp152.3.21.1openSUSE-SU-2021:1574-1
openSUSELeap 15.2nodejs1414.18.1-lp152.17.1openSUSE-SU-2021:1552-1
openSUSELeap 15.3nodejs1212.22.7-4.22.1openSUSE-SU-2021:3940-1
openSUSELeap 15.3nodejs1414.18.1-15.21.2openSUSE-SU-2021:3964-1
AlmaLinux8nodejs, nodejs-docs, nodejs-devel and 1 more1:14.18.2-2.module_el8.5.0+254+b4526b16ALSA-2022:0350
AlmaLinux8nodejs, nodejs-docs, nodejs-devel and 1 more1:14.18.2-2.module_el8.5.0+2618+8d46dafdALSA-2022:0350
AlmaLinux8nodejs-nodemon2.0.15-1.module_el8.5.0+2605+45d748afALSA-2022:0350
AlmaLinux8nodejs-nodemon2.0.15-1.module_el8.5.0+2618+8d46dafdALSA-2022:0350
AlmaLinux8nodejs-nodemon2.0.15-1.module_el8.6.0+2904+f21ad6f4ALSA-2022:0350
AlmaLinux8nodejs-packaging23-3.module_el8.4.0+2522+3bd42762ALSA-2022:0350
AlmaLinux8nodejs-packaging23-3.module_el8.5.0+2618+8d46dafdALSA-2022:0350
AlmaLinux8npm1:6.14.15-1.14.18.2.2.module_el8.5.0+254+b4526b16ALSA-2022:0350
AlmaLinux8npm1:6.14.15-1.14.18.2.2.module_el8.5.0+2618+8d46dafdALSA-2022:0350
Rocky Linux8nodejs1:14.18.2-2.module+el8.5.0+733+de4fee6cRLSA-2022:0350
Rocky Linux8nodejs-nodemon0:2.0.15-1.module+el8.5.0+721+4c107270RLSA-2022:0350
Rocky Linux8nodejs-packaging0:23-3.module+el8.3.0+100+234774f7RLSA-2022:0350
Rocky Linux8nodejs-packaging0:23-3.module+el8.5.0+733+de4fee6cRLSA-2022:0350
Rocky Linux8nodejs-packaging0:23-3.module+el8.7.0+1071+4bdda2a8RLSA-2022:0350
Alpinev3.11, v3.12nodejs12.22.6-r0ALPINE-CVE-2021-37712
Alpinev3.13, v3.14, v3.15 and 9 morenodejs14.17.6-r0ALPINE-CVE-2021-37712

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; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

Red Hat Enterprise Linux version 8 and Red Hat Software Collection both embed `node-tar` in the npm command. However, npm explicitly prevents the extraction of symlink via a filter. npm might still be affected via node-gyp, if the attacker is able to control the target URL.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 8nodejs:12-8060020220523160029.ad008a3aFixed 2022-06-21RHEA-2022:5139
Red Hat Enterprise Linux 8nodejs:14-8050020211213115342.c5368500Fixed 2022-02-01RHSA-2022:0350
Red Hat Enterprise Linux 8.1 Update Services for SAP Solutionsnodejs:12-8010020220518102644.c27ad7f8Fixed 2022-06-07RHEA-2022:4925
Red Hat Enterprise Linux 8.2 Extended Update Supportnodejs:12-8020020220523154454.4cda2c84Fixed 2022-06-28RHEA-2022:5221
Red Hat Enterprise Linux 8.4 Extended Update Supportnodejs:12-8040020220523155137.522a0ee4Fixed 2022-07-19RHEA-2022:5615
Red Hat Enterprise Linux 8.4 Extended Update Supportnodejs:14-8040020211213111158.522a0ee4Fixed 2022-01-25RHSA-2022:0246
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
OpenShift Service Mesh 2.0servicemesh-grafanaAffected
OpenShift Service Mesh 2.0servicemesh-prometheusAffected
Red Hat 3scale API Management Platform 2systemFix deferred
Red Hat Advanced Cluster Management for Kubernetes 2rhacm2/application-ui-rhel8Not affected
Red Hat Advanced Cluster Management for Kubernetes 2rhacm2/console-header-rhel8Affected
Red Hat Advanced Cluster Management for Kubernetes 2rhacm2/console-rhel8Will not fix
Red Hat Advanced Cluster Management for Kubernetes 2rhacm2/console-ui-rhel8Not affected
Red Hat Advanced Cluster Management for Kubernetes 2rhacm2/grc-ui-rhel8Not affected
Red Hat Advanced Cluster Management for Kubernetes 2rhacm2/kui-web-terminal-rhel8Not affected
Red Hat Advanced Cluster Management for Kubernetes 2rhacm2/mcm-topology-rhel8Will not fix
21 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-37712.

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-17 Using Malicious Files Likelihood: High · Severity: Very High
  • CAPEC-35 Leverage Executable Code in Non-Executable Files Likelihood: High · Severity: Very High
  • CAPEC-76 Manipulating Web Input to File System Calls Likelihood: High · Severity: Very High
  • CAPEC-132 Symlink Attack Likelihood: Low · Severity: High
  • CAPEC-64 Using Slashes and URL Encoding Combined to Bypass Validation Logic Likelihood: High · Severity: 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