8.2
HIGH
CVE-2021-32804
"Tar Node-Arbitrary File Creation/Overwrite Vulnerability"
Description

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.

INFO

Published Date :

Aug. 3, 2021, 7:15 p.m.

Last Modified :

Nov. 21, 2024, 6:07 a.m.

Remotely Exploitable :

No

Impact Score :

5.8

Exploitability Score :

1.8
Public PoC/Exploit Available at Github

CVE-2021-32804 has a 3 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-32804 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 Siemens sinec_infrastructure_network_services
1 Oracle graalvm
1 Tar_project 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-32804.

URL Resource
https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf Patch Third Party Advisory
https://github.com/npm/node-tar/commit/1f036ca23f64a547bdd6c79c1a44bc62e8115da4 Patch Third Party Advisory
https://github.com/npm/node-tar/security/advisories/GHSA-3jfq-g458-7qm9 Mitigation Third Party Advisory
https://www.npmjs.com/advisories/1770 Mitigation Third Party Advisory
https://www.npmjs.com/package/tar Product Third Party Advisory
https://www.oracle.com/security-alerts/cpuoct2021.html Patch Third Party Advisory
https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf Patch Third Party Advisory
https://github.com/npm/node-tar/commit/1f036ca23f64a547bdd6c79c1a44bc62e8115da4 Patch Third Party Advisory
https://github.com/npm/node-tar/security/advisories/GHSA-3jfq-g458-7qm9 Mitigation Third Party Advisory
https://www.npmjs.com/advisories/1770 Mitigation Third Party Advisory
https://www.npmjs.com/package/tar Product Third Party Advisory
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: 5 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.

None

Dockerfile JavaScript

Updated: 2 years, 11 months ago
1 stars 1 fork 1 watcher
Born at : Aug. 31, 2021, 4:32 a.m. This repo has been linked 1 different CVEs too.

Automatic monitor github cve using Github Actions

Python

Updated: 1 month, 2 weeks ago
1 stars 57 fork 57 watcher
Born at : April 7, 2021, 11:16 a.m. This repo has been linked 1008 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-32804 vulnerability anywhere in the article.

The following table lists the changes that have been made to the CVE-2021-32804 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/commit/1f036ca23f64a547bdd6c79c1a44bc62e8115da4
    Added Reference https://github.com/npm/node-tar/security/advisories/GHSA-3jfq-g458-7qm9
    Added Reference https://www.npmjs.com/advisories/1770
    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]

    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. 03, 2021

    Action Type Old Value New Value
    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 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]

    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]

    Aug. 12, 2021

    Action Type Old Value New Value
    Added CVSS V2 Metadata Victim must voluntarily interact with attack mechanism
    Added CVSS V2 NIST (AV:N/AC:M/Au:N/C:N/I:P/A:P)
    Added CVSS V3.1 NIST AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H
    Changed Reference Type https://github.com/npm/node-tar/commit/1f036ca23f64a547bdd6c79c1a44bc62e8115da4 No Types Assigned https://github.com/npm/node-tar/commit/1f036ca23f64a547bdd6c79c1a44bc62e8115da4 Patch, Third Party Advisory
    Changed Reference Type https://github.com/npm/node-tar/security/advisories/GHSA-3jfq-g458-7qm9 No Types Assigned https://github.com/npm/node-tar/security/advisories/GHSA-3jfq-g458-7qm9 Mitigation, Third Party Advisory
    Changed Reference Type https://www.npmjs.com/advisories/1770 No Types Assigned https://www.npmjs.com/advisories/1770 Mitigation, 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 CWE NIST CWE-22
    Added CPE Configuration OR *cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:* versions up to (excluding) 3.2.2 *cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:* versions from (including) 4.0.0 up to (excluding) 4.4.14 *cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:* versions from (including) 5.0.0 up to (excluding) 5.0.6 *cpe:2.3:a:tar_project:tar:*:*:*:*:*:node.js:*:* versions from (including) 6.0.0 up to (excluding) 6.1.1
  • CVE Modified by [email protected]

    Aug. 03, 2021

    Action Type Old Value New Value
    Changed Description 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. 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.
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.
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-32804 is associated with the following CWEs:

Exploit Prediction

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

0.69 }} -0.17%

score

0.79874

percentile

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