Home / rust-lang / rust / CVE-2024-43402
CVE-2024-43402: is it exploited, and which versions of rust-lang rust are affected and fixed?
CVE-2024-43402 is an OS command injection vulnerability in rust-lang rust. It is not known to be exploited: it is not in CISA's Known Exploited Vulnerabilities catalog (catalog 2026.11.30, read December 3, 2026, 16:09 UTC). Affected: rust < 1.81.0 (CVE record by GitHub_M). Fixed in 1.81.0 (NVD). Severity: High (8.2, CVSS 3.1, from GitHub_M).
Data checked December 3, 2026: last read CISA KEV December 3, 2026, 16:09 UTC, CVE record November 19, 2026, 07:11 UTC and NVD November 19, 2026, 07:27 UTC.
What is CVE-2024-43402?
Rust OS Command Injection/Argument Injection vulnerability
Rust is a programming language. The fix for CVE-2024-24576, where `std::process::Command` incorrectly escaped arguments when invoking batch files on Windows, was incomplete. Prior to Rust version 1.81.0, it was possible to bypass the fix when the batch file name had trailing whitespace or periods (which are ignored and stripped by Windows). To determine whether to apply the `cmd.exe` escaping rules, the original fix for the vulnerability checked whether the command name ended with `.bat` or `.cmd`. At the time that seemed enough, as we refuse to invoke batch scripts with no file extension. Windows removes trailing whitespace and periods when parsing file paths. For example, `.bat. .` is interpreted by Windows as `.bat`, but the original fix didn't check for that. Affected users who are using Rust 1.77.2 or greater can remove the trailing whitespace (ASCII 0x20) and trailing periods (ASCII 0x2E) from the batch file name to bypass the incomplete fix and enable the mitigations. Users are affected if their code or one of their dependencies invoke a batch script on Windows with trailing whitespace or trailing periods in the name, and pass untrusted arguments to it. Rust 1.81.0 will update the standard library to apply the CVE-2024-24576 mitigations to all batch files invocations, regardless of the trailing chars in the file name.
From the CVE record by GitHub_M, last updated September 4, 2024, 15:50 UTC.
Which versions are affected, and which fix it?
| Vendor | Product | Affected | Fixed or not affected from |
|---|---|---|---|
| rust-lang | rust | < 1.81.0 |
As the CVE record by GitHub_M states it, last updated September 4, 2024. Version ranges are the CNA's; a version the record calls not affected is usually the fix.
Which products and versions does the NVD list as affected?
| Vendor | Product | Versions | Type |
|---|---|---|---|
| rust-lang | rust | before 1.81.0 | application |
NVD analysis (status Analyzed), last modified June 17, 2026, 07:50 UTC.
How severe is CVE-2024-43402?
| Score | Version | Vector | Source |
|---|---|---|---|
| High 8.2 | CVSS 3.1 | CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H | GitHub_M |
| High 8.8 | CVSS 3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H | NVD |
Each score is shown as its source gave it: the CNA that wrote the record, CISA's ADP (vulnrichment) and the NVD. They can differ.
What the ratings mean: in CVSS 3 and 4, scores run from 0 to 10, with Low 0.1 to 3.9, Medium 4.0 to 6.9, High 7.0 to 8.9 and Critical 9.0 to 10.0. CVSS 2 has no Critical band: its High runs from 7.0 to 10.0. The vector lists how the flaw is reached (network, local), what an attacker needs (privileges, a user's click) and what it can harm.
Is CVE-2024-43402 exploited in the wild?
- CISA KEV
- Not listed (catalog 2026.11.30)
- CISA SSVC
- Exploitation: none; automatable: no; technical impact: total (CISA ADP, September 4, 2024)
- EPSS
- 0.74% probability of exploitation activity in the next 30 days, percentile 56.1 (FIRST EPSS, scores of December 3, 2026)
What kind of flaw is it?
- CWE-78 Improper Neutralization of Special Elements used in an OS Command
- CWE-88 Improper Neutralization of Argument Delimiters in a Command
Where are the vendor advisories and references?
- https://github.com/rust-lang/rust/security/advisories/GHSA-2xg3-7mm6-98jj x_refsource_CONFIRM
- https://blog.rust-lang.org/2024/04/09/cve-2024-24576.html x_refsource_MISC
- https://learn.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/file-folder-name-whitespace-characters x_refsource_MISC
When was it published, and where is the official record?
- Reserved
- August 12, 2024
- Published
- September 4, 2024, 15:29 UTC
- CVE record updated
- September 4, 2024, 15:50 UTC by GitHub_M
- NVD
- Analyzed, last modified June 17, 2026, 07:50 UTC
- Last checked
- CVE list November 19, 2026, 07:11 UTC; NVD November 19, 2026, 07:27 UTC; KEV December 3, 2026, 16:09 UTC; EPSS December 3, 2026
- Official record
- cve.org · NVD
What other CVEs affect rust?
- Apr 9, 2024CVE-2024-24576 rust-lang rust: OS command injection
- Jan 20, 2022CVE-2022-21658 rust-lang rust: race Condition Enabling Link Following
- Aug 7, 2021CVE-2021-29922 Rust-lang Rust: n/a
- Apr 14, 2021CVE-2017-20004 Rust-lang Rust: race condition
- Apr 14, 2021CVE-2020-36323 Rust-lang Rust: format string flaw
- Apr 14, 2021CVE-2018-25008 Rust-lang Rust: improper synchronization
- Apr 14, 2021CVE-2021-31162 Rust-lang Rust: double free
- Apr 11, 2021CVE-2015-20001 Rust-lang Rust: memory corruption (buffer overflow)
Questions about CVE-2024-43402
Is CVE-2024-43402 exploited in the wild?
Not as far as CISA knows: it is not in the Known Exploited Vulnerabilities catalog, read December 3, 2026, 16:09 UTC. FIRST's EPSS gives it a 0.74% chance of exploitation activity in the next 30 days (scores of December 3, 2026).
Which versions of rust-lang rust are affected by CVE-2024-43402?
rust < 1.81.0, per the CVE record by GitHub_M. The tables above give every range the sources list.
Which version fixes CVE-2024-43402?
1.81.0, per the NVD. Check the vendor's advisory before you rely on it.
How severe is CVE-2024-43402?
High (8.2, CVSS 3.1, from GitHub_M). The severity table above shows each score with its source.
Where is the official record of CVE-2024-43402?
The CVE Program's record is at cve.org and the NVD's at nvd.nist.gov. For a fix, the vendor's own advisory is the one to follow.