CVE-2021-37701
Tar Node-SSRF
Description
The npm package "tar" (aka node-tar) before versions 4.4.16, 5.0.8, and 6.1.7 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 the same name as the directory, where the symlink and directory names in the archive entry used backslashes as a path separator on posix systems. The cache checking logic used both `\` and `/` characters as path separators, however `\` is a valid filename character on posix systems. 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. Additionally, a similar confusion could arise on case-insensitive filesystems. If a tar archive contained a directory at `FOO`, followed by a symbolic link named `foo`, then on case-insensitive file systems, the creation of the symbolic link would remove the directory from the filesystem, but _not_ from the internal directory cache, as it would not be treated as a cache hit. A subsequent file entry within the `FOO` directory would then be placed in the target of the symbolic link, thinking that the directory had already been created. These issues were addressed in releases 4.4.16, 5.0.8 and 6.1.7. 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-9r2w-394v-53qc.
INFO
Published Date :
Aug. 31, 2021, 5:15 p.m.
Last Modified :
Nov. 21, 2024, 6:15 a.m.
Source :
[email protected]
Remotely Exploitable :
No
Impact Score :
6.0
Exploitability Score :
1.8
Public PoC/Exploit Available at Github
CVE-2021-37701 has a 1 public PoC/Exploit
available at Github.
Go to the Public Exploits
tab to see the list.
Affected Products
The following products are affected by CVE-2021-37701
vulnerability.
Even if cvefeed.io
is aware of the exact versions of the
products
that
are
affected, the information is not represented in the table below.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2021-37701
.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
A centralized repository of standalone security patches for open source libraries.
appsec backport cve devsecops fix hotfix open-source patch protection remediation seal security update upgrade vulnerability
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2021-37701
vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2021-37701
vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Modified by af854a3a-2127-422b-91ae-364da2661108
Nov. 21, 2024
Action Type Old Value New Value Added Reference https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf Added Reference https://github.com/npm/node-tar/security/advisories/GHSA-9r2w-394v-53qc Added Reference https://lists.debian.org/debian-lts-announce/2022/12/msg00023.html Added Reference https://www.debian.org/security/2021/dsa-5008 Added Reference https://www.npmjs.com/package/tar Added Reference https://www.oracle.com/security-alerts/cpuoct2021.html -
CVE Modified by [email protected]
May. 14, 2024
Action Type Old Value New Value -
Modified Analysis by [email protected]
Jan. 19, 2023
Action Type Old Value New Value Changed Reference Type https://lists.debian.org/debian-lts-announce/2022/12/msg00023.html No Types Assigned https://lists.debian.org/debian-lts-announce/2022/12/msg00023.html Mailing List, Third Party Advisory Changed CPE Configuration OR *cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:* OR *cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* *cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:* -
CVE Modified by [email protected]
Dec. 12, 2022
Action Type Old Value New Value Added Reference https://lists.debian.org/debian-lts-announce/2022/12/msg00023.html [No Types Assigned] -
Modified Analysis by [email protected]
Apr. 25, 2022
Action Type Old Value New Value Changed Reference Type https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf No Types Assigned https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf Patch, Third Party Advisory Changed CPE Configuration OR *cpe:2.3:a:npmjs:tar:*:*:*:*:*:node.js:*:* versions up to (excluding) 4.4.17 *cpe:2.3:a:npmjs:tar:*:*:*:*:*:node.js:*:* versions from (including) 5.0.0 up to (excluding) 5.0.9 *cpe:2.3:a:npmjs:tar:*:*:*:*:*:node.js:*:* versions from (including) 6.0.0 up to (excluding) 6.1.8 OR *cpe:2.3:a:npmjs:tar:*:*:*:*:*:node.js:*:* versions up to (excluding) 4.4.16 *cpe:2.3:a:npmjs:tar:*:*:*:*:*:node.js:*:* versions from (including) 5.0.0 up to (excluding) 5.0.8 *cpe:2.3:a:npmjs:tar:*:*:*:*:*:node.js:*:* versions from (including) 6.0.0 up to (excluding) 6.1.7 Added CPE Configuration OR *cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:* versions up to (excluding) 1.0.1.1 -
CVE Modified by [email protected]
Mar. 10, 2022
Action Type Old Value New Value Added Reference https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf [No Types Assigned] -
Modified Analysis by [email protected]
Dec. 04, 2021
Action Type Old Value New Value Changed Reference Type https://www.debian.org/security/2021/dsa-5008 No Types Assigned https://www.debian.org/security/2021/dsa-5008 Third Party Advisory Changed Reference Type https://www.oracle.com/security-alerts/cpuoct2021.html No Types Assigned https://www.oracle.com/security-alerts/cpuoct2021.html Patch, Third Party Advisory Added CWE NIST CWE-59 Added CPE Configuration OR *cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:* Added CPE Configuration OR *cpe:2.3:a:oracle:graalvm:20.3.3:*:*:*:enterprise:*:*:* *cpe:2.3:a:oracle:graalvm:21.2.0:*:*:*:enterprise:*:*:* -
CVE Modified by [email protected]
Nov. 12, 2021
Action Type Old Value New Value Added Reference https://www.debian.org/security/2021/dsa-5008 [No Types Assigned] -
CVE Modified by [email protected]
Oct. 20, 2021
Action Type Old Value New Value Added Reference https://www.oracle.com/security-alerts/cpuoct2021.html [No Types Assigned] -
Initial Analysis by [email protected]
Sep. 09, 2021
Action Type Old Value New Value Added CVSS V2 Metadata Victim must voluntarily interact with attack mechanism Added CVSS V2 NIST (AV:L/AC:M/Au:N/C:P/I:P/A:P) Added CVSS V3.1 NIST AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H Changed Reference Type https://github.com/npm/node-tar/security/advisories/GHSA-9r2w-394v-53qc No Types Assigned https://github.com/npm/node-tar/security/advisories/GHSA-9r2w-394v-53qc Patch, Third Party Advisory Changed Reference Type https://www.npmjs.com/package/tar No Types Assigned https://www.npmjs.com/package/tar Product, Third Party Advisory Added CPE Configuration OR *cpe:2.3:a:npmjs:tar:*:*:*:*:*:node.js:*:* versions up to (excluding) 4.4.17 *cpe:2.3:a:npmjs:tar:*:*:*:*:*:node.js:*:* versions from (including) 5.0.0 up to (excluding) 5.0.9 *cpe:2.3:a:npmjs:tar:*:*:*:*:*:node.js:*:* versions from (including) 6.0.0 up to (excluding) 6.1.8 -
CVE Modified by [email protected]
Aug. 31, 2021
Action Type Old Value New Value Changed Description The npm package "tar" (aka node-tar) before versions 4.4.16, 5.0.8, and 6.1.7 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 the same name as the directory, where the symlink and directory names in the archive entry used backslashes as a path separator on posix systems. The cache checking logic used both `\` and `/` characters as path separators, however `\` is a valid filename character on posix systems. 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. Additionally, a similar confusion could arise on case-insensitive filesystems. If a tar archive contained a directory at `FOO`, followed by a symbolic link named `foo`, then on case-insensitive file systems, the creation of the symbolic link would remove the directory from the filesystem, but _not_ from the internal directory cache, as it would not be treated as a cache hit. A subsequent file entry within the `FOO` directory would then be placed in the target of the symbolic link, thinking that the directory had already been created. These issues were addressed in releases 4.4.16, 5.0.8 and 6.1.7. 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-9r2w-394v-53qc. The npm package "tar" (aka node-tar) before versions 4.4.16, 5.0.8, and 6.1.7 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 the same name as the directory, where the symlink and directory names in the archive entry used backslashes as a path separator on posix systems. The cache checking logic used both `\` and `/` characters as path separators, however `\` is a valid filename character on posix systems. 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. Additionally, a similar confusion could arise on case-insensitive filesystems. If a tar archive contained a directory at `FOO`, followed by a symbolic link named `foo`, then on case-insensitive file systems, the creation of the symbolic link would remove the directory from the filesystem, but _not_ from the internal directory cache, as it would not be treated as a cache hit. A subsequent file entry within the `FOO` directory would then be placed in the target of the symbolic link, thinking that the directory had already been created. These issues were addressed in releases 4.4.16, 5.0.8 and 6.1.7. 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-9r2w-394v-53qc.
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2021-37701
is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2021-37701
weaknesses.
Exploit Prediction
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days.
0.16 }} 0.03%
score
0.52525
percentile