CVE-2021-32803

Source
https://nvd.nist.gov/vuln/detail/CVE-2021-32803
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-32803.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2021-32803
Aliases
Related
Published
2021-08-03T19:15:08Z
Modified
2024-12-05T15:28:02.804602Z
Severity
  • 8.1 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H CVSS Calculator
Summary
[none]
Details

The npm package "tar" (aka node-tar) before versions 6.1.2, 5.0.7, 4.4.15, and 3.2.3 has an arbitrary File Creation/Overwrite vulnerability via insufficient symlink protection. 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. This order of operations resulted in the directory being created and added to the node-tar directory cache. When a directory is present in the directory cache, subsequent calls to mkdir for that directory are skipped. However, this is also where node-tar checks for symlinks occur. 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. This issue was addressed in releases 3.2.3, 4.4.15, 5.0.7 and 6.1.2.

References

Affected packages

Alpine:v3.16 / tar

Package

Name
tar
Purl
pkg:apk/alpine/tar?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0

Alpine:v3.17 / tar

Package

Name
tar
Purl
pkg:apk/alpine/tar?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0

Alpine:v3.18 / tar

Package

Name
tar
Purl
pkg:apk/alpine/tar?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0

Alpine:v3.19 / tar

Package

Name
tar
Purl
pkg:apk/alpine/tar?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0

Alpine:v3.20 / tar

Package

Name
tar
Purl
pkg:apk/alpine/tar?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0

Alpine:v3.21 / tar

Package

Name
tar
Purl
pkg:apk/alpine/tar?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0

Debian:11 / node-tar

Package

Name
node-tar
Purl
pkg:deb/debian/node-tar?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
6.0.5+ds1+~cs11.3.9-1+deb11u1

Affected versions

6.*

6.0.5+ds1+~cs11.3.9-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Debian:12 / node-tar

Package

Name
node-tar
Purl
pkg:deb/debian/node-tar?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
6.1.7+~cs11.3.10-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Debian:13 / node-tar

Package

Name
node-tar
Purl
pkg:deb/debian/node-tar?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
6.1.7+~cs11.3.10-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Git / github.com/isaacs/node-tar

Affected ranges

Type
GIT
Repo
https://github.com/isaacs/node-tar
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Fixed
Type
GIT
Repo
https://github.com/npm/hosted-git-info
Events
Type
GIT
Repo
https://github.com/npm/node-tar
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Fixed

Affected versions

0.*

0.1.0
0.1.10
0.1.11
0.1.12
0.1.13
0.1.2
0.1.3
0.1.5
0.1.6
0.1.7
0.1.8
0.1.9

v0.*

v0.1.14
v0.1.15
v0.1.16
v0.1.17
v0.1.18
v0.1.19
v0.1.20

v1.*

v1.0.0
v1.0.1
v1.0.2
v1.0.3

v2.*

v2.0.0
v2.0.1
v2.1.0
v2.1.1
v2.2.1

v3.*

v3.0.0
v3.0.1
v3.1.0
v3.1.1
v3.1.10
v3.1.11
v3.1.12
v3.1.13
v3.1.14
v3.1.15
v3.1.2
v3.1.3
v3.1.4
v3.1.5
v3.1.6
v3.1.7
v3.1.8
v3.1.9
v3.2.0
v3.2.1
v3.2.2

v4.*

v4.0.0
v4.0.1
v4.0.2
v4.1.0
v4.1.1
v4.1.2
v4.2.0
v4.3.0
v4.3.1
v4.3.2
v4.3.3
v4.4.0
v4.4.1
v4.4.10
v4.4.11
v4.4.12
v4.4.13
v4.4.2
v4.4.3
v4.4.4
v4.4.5
v4.4.6
v4.4.7
v4.4.8
v4.4.9

v5.*

v5.0.0
v5.0.1
v5.0.2
v5.0.3
v5.0.4
v5.0.5

v6.*

v6.0.0
v6.0.1
v6.0.2
v6.0.3
v6.0.4
v6.0.5
v6.1.0
v6.1.1