totolr / Le-Dictateur

BOT discord multi-serveur avec musique, mini-rpg, système d'expérience et plein d'autres commandes funs et de modération !
GNU Affero General Public License v3.0
2 stars 1 forks source link

CVE-2021-37701 (High) detected in tar-4.4.13.tgz, tar-6.1.0.tgz #61

Closed mend-bolt-for-github[bot] closed 2 years ago

mend-bolt-for-github[bot] commented 2 years ago

CVE-2021-37701 - High Severity Vulnerability

Vulnerable Libraries - tar-4.4.13.tgz, tar-6.1.0.tgz

tar-4.4.13.tgz

tar for node

Library home page: https://registry.npmjs.org/tar/-/tar-4.4.13.tgz

Dependency Hierarchy: - canvas-2.6.1.tgz (Root Library) - node-pre-gyp-0.11.0.tgz - :x: **tar-4.4.13.tgz** (Vulnerable Library)

tar-6.1.0.tgz

tar for node

Library home page: https://registry.npmjs.org/tar/-/tar-6.1.0.tgz

Dependency Hierarchy: - opus-0.3.3.tgz (Root Library) - node-pre-gyp-0.1.0.tgz - :x: **tar-6.1.0.tgz** (Vulnerable Library)

Found in HEAD commit: a92ca3904f1bb573d92865dfe4106695885bc967

Found in base branch: master

Vulnerability Details

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.

Publish Date: 2021-08-31

URL: CVE-2021-37701

CVSS 3 Score Details (8.6)

Base Score Metrics: - Exploitability Metrics: - Attack Vector: Local - Attack Complexity: Low - Privileges Required: None - User Interaction: Required - Scope: Changed - Impact Metrics: - Confidentiality Impact: High - Integrity Impact: High - Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://github.com/npm/node-tar/security/advisories/GHSA-9r2w-394v-53qc

Release Date: 2021-08-31

Fix Resolution (tar): 6.1.7

Direct dependency fix Resolution (@discordjs/opus): 0.4.0


Step up your Open Source Security Game with WhiteSource here

stale[bot] commented 2 years ago

Ce problème a été automatiquement marqué comme obsolète car il n'a pas eu d'activité récente. Il sera fermé si aucune autre activité n'a lieu. Merci pour vos contributions.