BreachSpiderVerified, not vibes

CVE-2024-43402 in Rust-Lang Rust

High 8.8

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 ...

Affects 1 product from 1 vendor. Facts below cite their sources.

CVSS 3.18.8
EPSS0.7%
EPSS percentile46th
FixSee advisory

Requires local access, low complexity, low privileges required, no user interaction needed, can impact systems beyond the vulnerable component, full confidentiality impact, full integrity impact, full availability impact.

Affected products and versions

VendorProductAffected versions
Rust-Lang Rust < 1.81.0

A product listed here is affected only at the versions shown. Use the free check to test the exact version you run.

Fix and vendor advisory

View Vendor Advisory →

Vendor PSIRT: [email protected]

Exploitation

CISA known-exploitedNot in the CISA KEV catalog
Public exploitNot confirmed

Official description

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.

Source: NIST NVD / MITRE CVE.

Record details

CVE IDCVE-2024-43402
BreachSpider IDBS-2024-GLOBAL-204346-H
CVSS vectorCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Published2024-09-04
Last modified2026-06-17
Weakness (CWE)
SourceNVD

Weakness definitions

CWE-78: OS Command Injection

Attacker injects OS commands through application inputs passed to system() or equivalent calls, leading to arbitrary command execution.

CWE-88: CWE-88

Related attack patterns (CAPEC)

CAPEC-41 Using Meta-characters in E-mail Headers to Inject Malicious Payloads via CWE-88

CAPEC-43 Exploiting Multiple Input Interpretation Layers via CWE-78

CAPEC-108 Command Line Execution through SQL Injection via CWE-78

CAPEC-174 Flash Parameter Injection via CWE-88

CAPEC-460 HTTP Parameter Pollution (HPP) via CWE-88

Show all 9

CAPEC-6 Argument Injection via CWE-78

CAPEC-15 Command Delimiters via CWE-78

CAPEC-88 OS Command Injection via CWE-78, CWE-88

CAPEC-137 Parameter Injection via CWE-88

Mapping is CWE to CAPEC per MITRE CAPEC 3.9.

Analysis AI-written, not human-reviewed

CVE-2024-43402 affects Rust versions prior to 1.81.0, where the fix for CVE-2024-24576 was incomplete. This vulnerability allows bypassing the argument escaping rule for `std::process::Command` when invoking batch files on Windows if the batch file name has trailing whitespace or periods.

An attacker can exploit this vulnerability by crafting a batch file name with trailing whitespace or periods, which would bypass the intended argument escaping mechanism. This could lead to command injection if the attacker can control the batch file name or its location.

Questions

What is CVE-2024-43402?

CVE-2024-43402 affects Rust versions prior to 1.81.0, where the fix for CVE-2024-24576 was incomplete. This vulnerability allows bypassing the argument escaping rule for `std::process::Command` when invoking batch files on Windows if the batch file name has trailing whitespace or periods.

What is the CVSS score for CVE-2024-43402?

CVE-2024-43402 has CVSS 8.8 (High). Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H. EPSS: 0.7%.

Is CVE-2024-43402 actively exploited?

No confirmed active exploitation of CVE-2024-43402 as of 2026-09-25.

How do I remediate CVE-2024-43402?

Priority: HIGH. Advisory: https://blog.rust-lang.org/2024/04/09/cve-2024-24576.html PSIRT: [email protected]

What systems are affected by CVE-2024-43402?

CVE-2024-43402 affects Rust-Lang Rust.

For developers and AI agents

Run this check from your own code or agent

REST API

curl -s https://breachspider.com/api/v1/assets/correlate-cves \
 -H "Authorization: Bearer $BREACHSPIDER_API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"assets":[{"asset_id":"dev-1","vendor":"Rust-Lang","product":"Rust","version":"1.0"}]}'

API reference

Python SDK

pip install breachspider

PyPI · GitHub

MCP for AI agents

# hosted: add as a connector
https://mcp.breachspider.com/mcp
# local
pipx install breachspider-mcp

Setup for Claude, ChatGPT, Cursor

Free trial: 14 days, 750 device checks, no card.

Page facts from NVD, MITRE, CISA and vendor advisories, record last modified 2026-06-17.