Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2024-24576

CRITICAL 10.0EPSS 98%

Rusts's `std::process::Command` did not properly escape arguments of batch files on Windows

Mitigation

  • Upgrade rust to 1.77.2 or later.

Who should check

  • Anyone running rust-lang rust < 1.77.2

Vulnerability facts

Affected
rust-lang rust < 1.77.2
Fixed in
rust-lang rust 1.77.2
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Remote, no login needed
CVSS
10.0 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Network
  • Attack complexity: Low
  • Privileges required: None
  • User interaction: None
  • Scope: Changed (impact reaches other components)
  • Confidentiality impact: High
  • Integrity impact: High
  • Availability impact: High
EPSS
19.12% chance of exploitation in 30 days (percentile 98, 2026-11-26)
CWE
CWE-78, CWE-88
Published
Modified

Description

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.

Affected and fixed versions

Package / productAffectedFixedSource
rust-lang rust< 1.77.2—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2024-24576. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-24576.md
Affected: rust-lang rust < 1.77.2
Fixed in: rust-lang rust 1.77.2

Steps:
1. Search this machine and project for rust-lang rust: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

FAQ

Is CVE-2024-24576 being exploited?

There is no confirmed exploitation: CVE-2024-24576 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 19.12% chance of exploitation in the next 30 days (as of 2026-11-26).

How serious is CVE-2024-24576?

Critical: CVSS 10.0 (v3.1, scored by CNA). Remote, no login needed.

Which versions are affected by CVE-2024-24576?

rust-lang rust < 1.77.2.

Is there a fix for CVE-2024-24576?

Yes. Fixed in rust-lang rust 1.77.2. Upgrade rust to 1.77.2 or later.

How do I check if I'm affected by CVE-2024-24576?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors