CWE External 73 Control of File Name or Path
まだ誰も着手していません。
評価
調査の方向性
まず、レポートに示されている Create(string fileName) の実装を見つけ、issue にリンクされている CWE 73 のガイダンスを確認してください。ソースファイルもテストも指定されていないため、適用するパス制限を定義し、報告されたケースのカバレッジを追加してください。脆弱性が解消され、Veracode で finding が報告されなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Steps to reproduce
A recent Veracode scan on our application using the icsharpcode.sharpzilelib.dll has revealed a vulnerability flaw
Vulnerability CWE 73 External Control of File Name or Path.
While the version of the file in use is old and we intend to get the latest version. Can you advise if this can be addressed?
It is also reported the flaw exploitability status is set to 'Neutral'
public static ZipFile Create(string fileName)
{
if (fileName == null)
{
throw new ArgumentNullException(nameof(fileName));
}
FileStream fs = File.Create(fileName);
return new ZipFile
{
name_ = fileName,
baseStream_ = fs,
isStreamOwner = true
};
}
Expected behavior
Restrict access from the restricted location of the file system
Actual behavior
Vulnerability CWE 73 reported in Veracode scan
This could allow an attacker to access or modify system files or other files that are critical to the application.
An attacker can specify a path used in an operation on the filesystem.
By specifying the resource, the attacker gains a capability that would not otherwise be permitted.
Please see https://www.veracode.com/security/dotnet/cwe-73
Version of SharpZipLib
0.855.5.452
Obtained from (only keep the relevant lines)
- Compiled from source, commit: source_
- Downloaded from GitHub - Yes
- Package installed using NuGet - Yes
- 主要言語
- C#
- スター
- 3.9k
- フォーク
- 1k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
icsharpcode/SharpZipLib のほかの issue
-
*no response* bug
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
icsharpcode/SharpZipLib#905 · コメント 1 件 ·
-
bug bzip2
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
icsharpcode/SharpZipLib#904 ·
-
SetLevel in ZipFileオープンenhancement zip
難易度 2/5 1〜2日 初心者へのやさしさ 55/100
icsharpcode/SharpZipLib#903 ·
-
*no response* bug
難易度 4/5 3〜5日 初心者へのやさしさ 32/100
icsharpcode/SharpZipLib#901 · コメント 1 件 ·
-
*no response* bug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
icsharpcode/SharpZipLib#894 · コメント 1 件 ·
icsharpcode/SharpZipLib の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
umbraco/Umbraco.Automate#612 ·
メンテナーはふだん 1 日以内に返信
-
崩溃日志只按 CRLF 分行オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
PCL-Community/PCL-CE#3872 ·
メンテナーはふだん 1 日以内に返信
-
type:task ux
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
elsa-workflows/elsa-foundation#5253 ·
メンテナーはふだん 1 日以内に返信