CVE-2021-32804

Scores

EPSS

0.850high85.0%
0%20%40%60%80%100%

Percentile: 85.0%

CVSS

8.1high3.x
0246810

CVSS Score: 8.1/10

All CVSS Scores

CVSS 3.x
8.1

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H

CVSS 2.0
5.8

Vector: AV:N/AC:M/Au:N/C:N/I:P/A:P

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.

Scaner-VS 7 — a modern vulnerability management solution

Uses this database for vulnerability detection. High-speed search, cross-platform, advanced configuration audit, and flexible filtering. Suitable for organizations of any size.
Learn more about Scaner-VS 7

Sources

debiannvdredhatubuntu

CWEs

CWE-22

Related Vulnerabilities

Exploits

Exploit ID: CVE-2021-32804

Source: github-poc

URL: https://github.com/yamory/CVE-2021-32804

Vulnerable Software (28)

Type: Configuration

Product: node-tar

Operating System: ubuntu bionic 18.04

Trait:
{  "unfixed": true}

Source: ubuntu

Type: Configuration

Product: node-tar

Operating System: ubuntu focal 20.04

Trait:
{  "unfixed": true}

Source: ubuntu

Type: Configuration

Product: node-tar

Operating System: ubuntu hirsute 21.04

Trait:
{  "unfixed": true}

Source: ubuntu

Type: Configuration

Product: node-tar

Operating System: ubuntu impish 21.10

Trait:
{  "unfixed": true}

Source: ubuntu

Type: Configuration

Product: node-tar

Operating System: ubuntu kinetic 22.10

Trait:
{  "unfixed": true}

Source: ubuntu

Type: Configuration

Product: node-tar

Operating System: ubuntu lunar 23.04

Trait:
{  "unfixed": true}

Source: ubuntu

Type: Configuration

Product: node-tar

Operating System: ubuntu mantic 23.10

Trait:
{  "unfixed": true}

Source: ubuntu

Type: Configuration

Product: node-tar

Operating System: ubuntu oracular 24.10

Trait:
{  "unfixed": true}

Source: ubuntu

Type: Configuration

Product: node-tar

Operating System: ubuntu plucky 25.04

Trait:
{  "unfixed": true}

Source: ubuntu

Type: Configuration

Product: node-tar

Operating System: ubuntu trusty 14.04

Trait:
{  "unfixed": true}

Source: ubuntu

Type: Configuration

Product: node-tar

Operating System: ubuntu xenial 16.04

Trait:
{  "unfixed": true}

Source: ubuntu

Type: Configuration

Product: node-tar

Operating System: debian

Trait:
{  "fixed": "6.1.7+~cs11.3.10-1"}

Source: debian

Type: Configuration

Product: node-tar

Operating System: debian bullseye 11

Trait:
{  "fixed": "6.0.5+ds1+~cs11.3.9-1+deb11u1"}

Source: debian

Type: Configuration

Product: node-tar

Operating System: debian buster 10

Trait:
{  "fixed": "4.4.6+ds1-3+deb10u1"}

Source: debian

Type: Configuration

Product: node-tar

Operating System: debian stretch 9

Trait:
{  "unaffected": true}

Source: debian

Type: Configuration

Product: nodejs

Operating System: rhel

Trait:
{  "fixed": "12-8040020210817133458.522a0ee4"}

Source: redhat

Type: Configuration

Product: nodejs

Operating System: rhel

Trait:
{  "fixed": "14-8040020210817165654.522a0ee4"}

Source: redhat

Type: Configuration

Product: nodejs

Operating System: rhel

Trait:
{  "fixed": "12-8010020210817113128.c27ad7f8"}

Source: redhat

Type: Configuration

Product: nodejs

Operating System: rhel

Trait:
{  "fixed": "12-8020020210817125332.4cda2c84"}

Source: redhat

Type: Configuration

Product: rh-nodejs12-nodejs

Operating System: rhel

Trait:
{  "fixed": "12.22.5-1.el7"}

Source: redhat