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.

Published: 2024-04-09 Last update: 2026-01-05 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2024-24576 is rated High Risk (76/100): CVSS Critical severity, with high exploitation likelihood (EPSS 80.54%, 99th percentile). Core evidence: EPSS ranks this CVE among the most likely to be exploited in the near term. EPSS rose +1.33% over the last day, indicating growing attacker interest. Mandatory action: High exploitation likelihood—assess exposure and prioritize remediation.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Exploit prediction scoring system (EPSS) score for CVE-2024-24576

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-04-28 79.21% 80.54% +1.33%
2 2026-03-04 78.60% 79.21% +0.61%
3 2026-03-01 78.60%

Full EPSS history (45 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2024-24576

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
10.0 3.1 CRITICAL
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:C)
Breaking this can reach past the original component and bite other resources—bigger blast radius.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
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 Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:C)
Breaking this can reach past the original component and bite other resources—bigger blast radius.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
3.9 6.0 [email protected]

Weakness enumeration for CVE-2024-24576

OS Trackers for CVE-2024-24576

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

Affected software / configurations for CVE-2024-24576

Vendor Product Version Raw 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:*:*:*:*:*:*:*:*

References for CVE-2024-24576

URL Tags
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 Vendor Advisory Mitigation
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