NVD Vulnerability Detail
Search Exploit, PoC
CVE-2021-37701
Summary

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.

Publication Date Sept. 1, 2021, 2:15 a.m.
Registration Date Sept. 1, 2021, 10 a.m.
Last Update Nov. 21, 2024, 3:15 p.m.
CVSS3.1 : HIGH
スコア 8.6
Vector CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
攻撃元区分(AV) ローカル
攻撃条件の複雑さ(AC)
攻撃に必要な特権レベル(PR) 不要
利用者の関与(UI)
影響の想定範囲(S) 変更あり
機密性への影響(C)
完全性への影響(I)
可用性への影響(A)
CVSS2.0 : MEDIUM
Score 4.4
Vector AV:L/AC:M/Au:N/C:P/I:P/A:P
攻撃元区分(AV) ローカル
攻撃条件の複雑さ(AC)
攻撃前の認証要否(Au) 不要
機密性への影響(C)
完全性への影響(I)
可用性への影響(A)
Get all privileges. いいえ
Get user privileges いいえ
Get other privileges いいえ
User operation required はい
Affected software configurations
Configuration1 or higher or less more than less than
cpe:2.3:a:npmjs:tar:*:*:*:*:*:node.js:*:* 4.4.16
cpe:2.3:a:npmjs:tar:*:*:*:*:*:node.js:*:* 5.0.0 5.0.8
cpe:2.3:a:npmjs:tar:*:*:*:*:*:node.js:*:* 6.0.0 6.1.7
Configuration2 or higher or less more than less than
cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*
cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*
Configuration3 or higher or less more than less than
cpe:2.3:a:oracle:graalvm:20.3.3:*:*:*:enterprise:*:*:*
cpe:2.3:a:oracle:graalvm:21.2.0:*:*:*:enterprise:*:*:*
Configuration4 or higher or less more than less than
cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:* 1.0.1.1
Related information, measures and tools
Common Vulnerabilities List

JVN Vulnerability Information
npm パッケージ tar におけるパストラバーサルの脆弱性
Title npm パッケージ tar におけるパストラバーサルの脆弱性
Summary

npm パッケージ tar (別名 node-tar) には、パストラバーサルの脆弱性、およびリンク解釈に関する脆弱性が存在します。

Possible impacts 情報を取得される、情報を改ざんされる、およびサービス運用妨害 (DoS) 状態にされる可能性があります。
Solution

ベンダより正式な対策が公開されています。ベンダ情報を参照して適切な対策を実施してください。

Publication Date Aug. 31, 2021, midnight
Registration Date July 15, 2022, 4:55 p.m.
Last Update July 15, 2022, 4:55 p.m.
Affected System
オラクル
Oracle GraalVM 
Debian
Debian GNU/Linux 
シーメンス
SINEC Infrastructure Network Services 
node-tar project
node-tar 4.4.16 未満
node-tar 5.0.8 未満
node-tar 6.1.7 未満
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
ベンダー情報
その他
Change Log
No Changed Details Date of change
1 [2022年07月15日]
  掲載
July 15, 2022, 4:55 p.m.