CVE-2024-24576 | Rusts's `std::process::Command` did not properly escape arguments of batch files on Windows

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.

公開: 2024-04-09 最終更新: 2026-06-17 Assigner: [email protected] ソース: [email protected]

総合評価: CVE-2024-24576 は高リスク(69/100)。CVSS 深刻度は重大。悪用される可能性が高い(EPSS 20.34%、97 パーセンタイル) 根拠: EPSS 上、短期間での悪用可能性は高い水準です。 推奨対応: 悪用可能性が高いため、影響範囲の確認と修補の優先付けを推奨します。

リスクは変動します。再評価に基づき、本ページの表示内容を更新しています。

CVE-2024-24576 の EPSS(Exploit Prediction Scoring System)スコア

EPSS は日次で悪用されやすさの相対度合いを推定します。パーセンタイルは採点済み CVE の中での相対位置(高いほど相対的に深刻)を示します。

# 日付 旧 EPSS スコア 新 EPSS スコア Δ(新 − 旧)
1 2026-06-15 80.54% 20.34% -60.20%
2 2026-04-28 79.21% 80.54% +1.33%
3 2026-03-04 79.21%

EPSS の全履歴 (全 46 件)

CVE-2024-24576 の CVSS(Common Vulnerability Scoring System)指標

この CVE の CVSS 指標。

ベーススコア バージョン 深刻度 ベクトル 悪用しやすさ 影響 スコアの出典
10.0 3.1 CRITICAL
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H クリックして展開
攻撃ベクター (AV:N)
インターネットなど、ルーティングされたネットワーク越しに遠隔から悪用しうる。端末の前にいる必要はない。
攻撃の複雑さ (AC:L)
攻撃者が条件を満たせば、レース条件や珍しい構成に依存せずに再現しやすい。
必要な権限 (PR:N)
事前のログインや昇格は不要で、匿名アクセスのまま踏み台にしうる。
ユーザーの関与 (UI:N)
メールのリンクを開く、マクロを有効にするなど、被害者の協力がなくても成立しうる。
スコープ (S:C)
脆弱箇所を足がかりに、別コンポーネントや別権限域まで影響が広がりうる。
機密性への影響 (C:H)
広範な機微データの読み取りや持ち出しが現実的。
完全性への影響 (I:H)
権限の奪取や広範なログ改竄など、システムの信頼根拠を揺るがす改ざんが現実的。
可用性への影響 (A:H)
長時間のサービス停止、データ損壊による復旧不能に近い状態など、利用者に著しい不便を与えうる。
3.9 6.0 [email protected]
10.0 3.1 CRITICAL
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H クリックして展開
攻撃ベクター (AV:N)
インターネットなど、ルーティングされたネットワーク越しに遠隔から悪用しうる。端末の前にいる必要はない。
攻撃の複雑さ (AC:L)
攻撃者が条件を満たせば、レース条件や珍しい構成に依存せずに再現しやすい。
必要な権限 (PR:N)
事前のログインや昇格は不要で、匿名アクセスのまま踏み台にしうる。
ユーザーの関与 (UI:N)
メールのリンクを開く、マクロを有効にするなど、被害者の協力がなくても成立しうる。
スコープ (S:C)
脆弱箇所を足がかりに、別コンポーネントや別権限域まで影響が広がりうる。
機密性への影響 (C:H)
広範な機微データの読み取りや持ち出しが現実的。
完全性への影響 (I:H)
権限の奪取や広範なログ改竄など、システムの信頼根拠を揺るがす改ざんが現実的。
可用性への影響 (A:H)
長時間のサービス停止、データ損壊による復旧不能に近い状態など、利用者に著しい不便を与えうる。
3.9 6.0 [email protected]

CVE-2024-24576 の弱点分類(列挙)

CVE-2024-24576 の OS トラッカー

vendor priority summary link
debian unimportant CVE-2024-24576 unimportant priority: Debian including 1 source packages (rustc), 5 status rows across 5 suites (bookworm, bullseye, forky, sid, trixie): resolved 5. https://security-tracker.debian.org/tracker/CVE-2024-24576
redhat low https://access.redhat.com/security/cve/CVE-2024-24576
ubuntu negligible CVE-2024-24576 negligible priority: Ubuntu including 2 source packages (cargo, rustc), 13 status rows across 7 suites (bionic, focal, jammy, mantic, trusty, upstream, xenial): not-affected 12, DNE 1. https://ubuntu.com/security/CVE-2024-24576

CVE-2024-24576 の影響を受けるソフトウェア/構成

ベンダー 製品 バージョン 生の CPE
fedoraproject fedora 38 cpe:2.3:o:fedoraproject:fedora:38:*:*:*:*:*:*:*
fedoraproject fedora 39 cpe:2.3:o:fedoraproject:fedora:39:*:*:*:*:*:*:*
fedoraproject fedora 40 cpe:2.3:o:fedoraproject:fedora:40:*:*:*:*:*:*:*
rust-lang rust < 1.77.2 cpe:2.3:a:rust-lang:rust:*:*:*:*:*:*:*:*

CVE-2024-24576 の参考情報

URL タグ
http://www.openwall.com/lists/oss-security/2024/04/09/16 Mailing List Third Party Advisory
https://doc.rust-lang.org/std/io/enum.ErrorKind.html#variant.InvalidInput Technical Description
https://doc.rust-lang.org/std/os/windows/process/trait.CommandExt.html#tymethod.raw_arg Technical Description
https://doc.rust-lang.org/std/process/struct.Command.html Technical Description
https://doc.rust-lang.org/std/process/struct.Command.html#method.arg Technical Description
https://doc.rust-lang.org/std/process/struct.Command.html#method.args Technical Description
https://github.com/rust-lang/rust/issues Issue Tracking
https://github.com/rust-lang/rust/security/advisories/GHSA-q455-m56c-85mh Mitigation Vendor Advisory
https://lists.fedoraproject.org/archives/list/[email protected]/message/N323QAEEUVTJ354BTVQ7UB6LYXUX2BCL/ Mailing List Vendor Advisory
https://lists.fedoraproject.org/archives/list/[email protected]/message/RPH3PF7DVSS2LVIRLW254VWUPVKJN46P/ Mailing List Vendor Advisory
https://lists.fedoraproject.org/archives/list/[email protected]/message/W7WRFOIAZXYUPGXGR5UEEW7VTTOD4SZ3/ Mailing List Vendor Advisory
https://www.rust-lang.org/policies/security Technical Description
https://www.kb.cert.org/vuls/id/123335 Third Party Advisory
cvelogic Threat Intelligence