製品・ソフトウェアに関する情報
Fedora Project等の複数ベンダの製品における複数の脆弱性
Title Fedora Project等の複数ベンダの製品における複数の脆弱性
Summary

Rustはプログラミング言語です。Rust標準ライブラリのバージョン1.77.2以前のWindows環境では、Commandを利用してバッチファイル(batやcmd拡張子)を実行する際、引数のエスケープ処理が十分でなく、攻撃者が細工した引数を渡すことで任意のシェルコマンドが実行される可能性がありました。この問題は、Windows上で信頼できない入力をバッチファイルの引数として渡す場合において、特に深刻です。他のプラットフォームや用途には影響しません。Command::argやCommand::args APIについては、渡した引数がそのままプロセスに渡され、シェルによる評価が行われないとドキュメントに明記されていますので、信頼できない入力も安全に扱えると期待されていました。しかし、Windowsではプロセスへ渡す引数が1つの文字列としてAPIに渡され、実際の分割や解釈が呼び出されたプログラムごとに異なるため、処理が複雑になります。特に、cmd.exe(バッチファイルの実行時に使用)には独自の分割規則があるため、Rust標準ライブラリでのエスケープ処理が不十分でした。根本的な解決策として、エスケープできない場合にはエラー(InvalidInput)を返すようにCommand APIが修正されました。この修正はRust 1.77.2に含まれています。

Possible impacts 当該ソフトウェアが扱う全ての情報が外部に漏れる可能性があります。 また、当該ソフトウェアが扱う全ての情報が書き換えられる可能性があります。 さらに、当該ソフトウェアが完全に停止する可能性があります。 そして、この脆弱性を悪用した攻撃により、他のソフトウェアにも影響が及ぶ可能性があります。 
Solution

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

Publication Date April 9, 2024, midnight
Registration Date Jan. 7, 2026, 6:25 p.m.
Last Update Jan. 7, 2026, 6:25 p.m.
CVSS3.0 : 緊急
Score 10
Vector CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Affected System
Fedora Project
Fedora 38
Fedora 39
Fedora 40
The Rust Programming Language
Rust 1.77.2 未満
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
ベンダー情報
その他
Change Log
No Changed Details Date of change
1 [2026年01月07日]
  掲載
Jan. 7, 2026, 6:25 p.m.

NVD Vulnerability Information
CVE-2024-24576
Summary

Rust is a programming language. The Rust Security Response WG was notified that the Rust standard library prior to version 1.77.2 did not properly escape arguments when invoking batch files (with the `bat` and `cmd` extensions) on Windows using the `Command`. An attacker able to control the arguments passed to the spawned process could execute arbitrary shell commands by bypassing the escaping. The severity of this vulnerability is critical for those who invoke batch files on Windows with untrusted arguments. No other platform or use is affected.

The `Command::arg` and `Command::args` APIs state in their documentation that the arguments will be passed to the spawned process as-is, regardless of the content of the arguments, and will not be evaluated by a shell. This means it should be safe to pass untrusted input as an argument.

On Windows, the implementation of this is more complex than other platforms, because the Windows API only provides a single string containing all the arguments to the spawned process, and it's up to the spawned process to split them. Most programs use the standard C run-time argv, which in practice results in a mostly consistent way arguments are splitted.

One exception though is `cmd.exe` (used among other things to execute batch files), which has its own argument splitting logic. That forces the standard library to implement custom escaping for arguments passed to batch files. Unfortunately it was reported that our escaping logic was not thorough enough, and it was possible to pass malicious arguments that would result in arbitrary shell execution.

Due to the complexity of `cmd.exe`, we didn't identify a solution that would correctly escape arguments in all cases. To maintain our API guarantees, we improved the robustness of the escaping code, and changed the `Command` API to return an `InvalidInput` error when it cannot safely escape an argument. This error will be emitted when spawning the process.

The fix is included in Rust 1.77.2. Note that the new escaping logic for batch files errs on the conservative side, and could reject valid arguments. Those who implement the escaping themselves or only handle trusted inputs on Windows can also use the `CommandExt::raw_arg` method to bypass the standard library's escaping logic.

Publication Date April 10, 2024, 3:15 a.m.
Registration Date April 10, 2024, 10:01 a.m.
Last Update Nov. 21, 2024, 5:59 p.m.
Related information, measures and tools
Common Vulnerabilities List