← Back to KEV catalog

CVE-2024-24576

Exploitation: poc CVSS 10.0 CRITICAL

CVSS base score: 10.0 (Critical) vendor CNA · v3.1

Score assigned by the vendor's own CVE Numbering Authority (CNA); CISA's Vulnrichment program adds a score only when the CNA omits one.

Vendor: rust-lang   Product: rust

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.

Lifecycle Timeline

Each milestone comes from a different source, so gaps between them are gaps in what those sources publish, not evidence that nothing happened. EPSS history for this CVE holds 140 points from 2024-04-13, tracked daily from 2026-09-09; earlier points are weekly, which dates a spike to within a week. Peak probability 84.3% on 2025-08-30.

Published Applicability

Red Hat CSAF/VEX 0 affected · 0 fixed · 34 not affected
OSV.dev (incl. GHSA) 1 affected · 1 fixed · 0 not affected
CVE List v5 (CNA container) 1 affected · 0 fixed · 0 not affected
CVE List v5 (ADP/Vulnrichment) 1 affected · 0 fixed · 0 not affected

Check whether a specific version is affected →

What each source publishes about which product versions carry this vulnerability, kept as written rather than merged. Absence here means no source has published applicability data, not that nothing is affected.

Research & News Coverage

No mentions found in monitored research blogs or news feeds.

Detection & Exploitation

Exploit / Pen Test
Network IDS/IPS
none published
Host / SIEM
none published

Coverage across public collections only: Nuclei and OpenVAS NVT (scan); Snort and Suricata ET Open (network); Sigma and YARA (host/SIEM); Metasploit, Exploit-DB and public GitHub repositories (exploit). Absence here means nothing public was found, not that detection is impossible.
GitHub PoC repositories are collected automatically by PoC-in-GitHub (CC0) and are not vetted: some are fakes and some are malware. Treat them as evidence that code was published, not as code to run.
OpenVAS coverage derives from the Greenbone Community Feed, made available under the Open Database License (ODbL) v1.0; its individual Vulnerability Tests are licensed GNU GPL v2.

Distribution Status

Debian · rustc bookworm trixie forky sid scope: local

Where the distribution has shipped a fix, and in which version. Green means the release has resolved it, amber that it is still open. Data from the Debian Security Tracker, used under Debian's MIT / GPLv2+ terms. Debian is upstream of several other distributions, so a fix here often precedes theirs.

CISA Assessment (Vulnrichment / SSVC)

poc
yes
total
—
10.0 CRITICAL
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
CWE-78 — Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
2024-05-18

D3FEND Countermeasures

Defensive techniques inferred by MITRE D3FEND from the underlying weakness (CWE-78) — general hardening and detection guidance for this weakness class, not a vendor patch for this specific CVE.

Listed By

SourceDateRecord
CISA Vulnrichment 2024-05-18 source record →

Referenced in Advisories

DateAdvisoryIssuer
2024-04-10 2024-035: Critical Vulnerability in Rust on Windows CERT-EU

Weaponization Timeline — Offensive & Testing Tools

No exploit-tool sightings recorded for this CVE.

Evidence tiers are explained on the About page — a merged Metasploit module is far stronger evidence than a distro package mention.

External References