CVE Intelligence
Skip to main content
criticalRemote Code Execpublic exploit

CVE-2024-24576

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 Updated Sources: NVD, rust-lang (CNA), GitHub, Red Hat (VEX)

Triage

Is it exploited, how likely is exploitation, what does it touch, and how severe do the scoring sources call it.

Exploitation

Exploit code

public exploit, none observed

EPSS

20%

chance of exploitation in 30 days

Affects

rust-lang

rust

CVSS base

10

critical

CISA SSVC assessment

Three decision points CISA publishes for the CVEs it assesses · SSVC 2.0.3. A stakeholder decision, not a severity score.

CISA

Exploitation

PoC

none · proof-of-concept · active

Automatable

Yes

can an attacker script all four kill-chain steps

Technical impact

Total

partial · total control of the vulnerable component

Remediation

The vendor's own words where we have them.

Upgrade rust to a fixed release. Apply vendor patches per advisory and restrict external exposure of the affected component until patched.

Red Hat VEX · CVE-2024-24576

fixed0affected0not affected34

First 24 hours

Ordered from the record's own fields — exposure first, because you cannot patch what you have not found.

  • Identify exposed assets running affected vendor/product/version combinations.
  • Prioritize based on EPSS, PoC availability, and external exposure.
  • Search available logs for exploit probes, errors, authentication anomalies, or suspicious child processes matching the vulnerability class.

Affected scope

Vendor, product and version as the advisories word them.

VendorProductVersionsStatus
rust-langrust< 1.77.2Vulnerable

Attack characteristics

The CVSS vector, decoded. It describes the attack, not your exposure to it.

Availability

High

Confidentiality

High

Integrity

High

Scope

Changed

Attack Complexity

Low

Attack Vector

Network

Privileges Req

None

User Interaction

None

Every base score collected

Sources score independently and disagree; each row says who scored it and under which version.

ScoreVersionSeverityExpl.ImpactSource
10CVSS 3.1critical3.96GitHub (CNA), NVD, rust-lang (CNA)

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Weakness & attack patterns

  • CWE-78OS Command Injection
  • CWE-88

Inferred from the weakness class — not observed against this CVE.

CAPEC-242 · Code InjectionCAPEC-35 · Leverage Executable Code in Non-Executable Files

Public exploit

Capability, not use: code existing is a different claim from anyone running it.

Repositories

54

Detection

Read off the CVSS vector and the weakness class. Starting points, not rules we have tested.

  • Prioritize edge telemetry for network-reachable rust.
  • Monitor for scanner or exploit-pattern traffic after 54 public PoC repositories were reported.
web/proxy/WAF logsapplication logsnetwork IDS/IPSEDR process telemetryhost service logs

Timeline

What happened to this CVE, newest first — with the readings a source repeats on a schedule counted underneath rather than listed.

  1. 2026
  2. Added · CVSS 3.1 10.0 (AV:N)

    Jun 17, 2026 · NVD

  3. 2024
  4. Initial · CVE published

    Apr 9, 2024 · NVD

References

18 on the record

Elsewhere on this site

Not in any source we poll

Listed rather than left blank: an empty field and an unmeasured one look identical on screen, and only one is a reason to look elsewhere.

  • No confirmed IOCs, IP addresses, domains, file hashes, or malware artifacts supplied.
  • No organization-specific asset inventory, compensating-control status, or patch deployment evidence supplied.
  • No exploit packet captures, log samples, or incident case IDs supplied.
Answered from this record1

What should defenders know first?

CVE-2024-24576 is Rusts's `std::process::Command` did not properly escape arguments of batch files on Windows, a critical vulnerability affecting rust from rust-lang. The current evidence does not list it in CISA KEV, and the exploit status is: Active exploitation is not confirmed from current sources for CVE-2024-24576. Public exploit evidence is: 54 public PoC repositories reported; 0 marked weaponized in current dataset. The affected-version evidence is listed in the key facts and affected products tables. Defenders should first verify whether exposed or business-critical assets run those versions, then apply vendor patches or mitigations, restrict reachable attack surface, and preserve logs for detection review. CVSS 10 describes technical severity, while EPSS 20% helps estimate near-term exploit likelihood; neither replaces asset context. Unknown fields should remain explicit in tickets, and threat actor, IOC, victimology, or payload claims should not be added unless a cited source supports them. Monitor CISA KEV, vendor advisories, NVD changes, public PoC repositories, and internal telemetry for update triggers.