8.6
HIGH
CVE-2021-37712
TAR Node-Code Execution and File Overwrite Vulnerability
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.

INFO

Published Date :

Aug. 31, 2021, 5:15 p.m.

Last Modified :

Feb. 23, 2023, 2:28 a.m.

Remotely Exploitable :

No

Impact Score :

6.0

Exploitability Score :

1.8
Public PoC/Exploit Available at Github

CVE-2021-37712 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-37712 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.

ID Vendor Product Action
1 Debian debian_linux
1 Siemens sinec_infrastructure_network_services
1 Oracle graalvm
1 Npmjs tar
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-37712.

URL Resource
https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf Patch Third Party Advisory
https://github.com/npm/node-tar/security/advisories/GHSA-qq89-hq3f-393p Patch Third Party Advisory
https://lists.debian.org/debian-lts-announce/2022/12/msg00023.html Mailing List Third Party Advisory
https://www.debian.org/security/2021/dsa-5008 Third Party Advisory
https://www.npmjs.com/package/tar Product
https://www.oracle.com/security-alerts/cpuoct2021.html Patch Third Party Advisory

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

Updated: 4 months, 3 weeks ago
182 stars 0 fork 0 watcher
Born at : July 30, 2023, 4:46 p.m. This repo has been linked 265 different CVEs too.

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-37712 vulnerability anywhere in the article.

The following table lists the changes that have been made to the CVE-2021-37712 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 [email protected]

    May. 14, 2024

    Action Type Old Value New Value
  • Modified Analysis by [email protected]

    Feb. 23, 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 Reference Type https://www.npmjs.com/package/tar Product, Third Party Advisory https://www.npmjs.com/package/tar Product
    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
    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-qq89-hq3f-393p No Types Assigned https://github.com/npm/node-tar/security/advisories/GHSA-qq89-hq3f-393p 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 AND OR *cpe:2.3:a:npmjs:tar:*:*:*:*:*:node.js:*:* versions up to (including) 4.4.17 *cpe:2.3:a:npmjs:tar:*:*:*:*:*:node.js:*:* versions from (including) 5.0.0 up to (including) 5.0.9 *cpe:2.3:a:npmjs:tar:*:*:*:*:*:node.js:*:* versions from (including) 6.0.0 up to (including) 6.1.8 OR cpe:2.3:o:microsoft:windows:-:*:*:*:*:*:*:*
  • 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.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. 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.
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.
Exploit Prediction

EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days.

0.13 }} 0.02%

score

0.47731

percentile

CVSS31 - Vulnerability Scoring System
Attack Vector
Attack Complexity
Privileges Required
User Interaction
Scope
Confidentiality
Integrity
Availability