CVEfocus › CVE database › CVE-2024-43402

CVE-2024-43402Rust OS Command Injection/Argument Injection vulnerability

CVSS 8.2 HighEPSS 0.7% (higher than 46% of CVEs)Published 2024-09-04Updated 2024-09-04Assigner: GitHub_M

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.

CWE-78CWE-88

What to do

None of the Linux distributions or Windows releases we track list an affected package for this CVE. Check the vendor-reported products below.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

52Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 24.04rustcNot affected
vulnerable_code_not_present
Ubuntu 22.04rustcNot affected
vulnerable_code_not_present
Red Hat Enterprise Linux 10cargoNot affected
Red Hat Enterprise Linux 10clippyNot affected
Red Hat Enterprise Linux 10rustNot affected
Red Hat Enterprise Linux 10rust-analyzerNot affected
Red Hat Enterprise Linux 10rust-debugger-commonNot affected
Red Hat Enterprise Linux 10rust-docNot affected
Red Hat Enterprise Linux 10rust-gdbNot affected
Red Hat Enterprise Linux 10rust-lldbNot affected
Red Hat Enterprise Linux 10rust-srcNot affected
Red Hat Enterprise Linux 10rust-std-staticNot affected
Red Hat Enterprise Linux 10rust-std-static-aarch64-unknown-none-softfloatNot affected
Red Hat Enterprise Linux 10rust-std-static-wasm32-unknown-unknownNot affected
Red Hat Enterprise Linux 10rust-std-static-wasm32-wasip1Not affected
Red Hat Enterprise Linux 10rust-std-static-x86_64-unknown-noneNot affected
Red Hat Enterprise Linux 10rust-toolsetNot affected
Red Hat Enterprise Linux 10rust-toolset-srpm-macrosNot affected
Red Hat Enterprise Linux 10rustfmtNot affected
Red Hat Enterprise Linux 9cargoNot affected
Red Hat Enterprise Linux 9clippyNot affected
Red Hat Enterprise Linux 9rustNot affected
Red Hat Enterprise Linux 9rust-analysisNot affected
Red Hat Enterprise Linux 9rust-analyzerNot affected
Red Hat Enterprise Linux 9rust-debugger-commonNot affected
Red Hat Enterprise Linux 9rust-docNot affected
Red Hat Enterprise Linux 9rust-gdbNot affected
Red Hat Enterprise Linux 9rust-lldbNot affected
Red Hat Enterprise Linux 9rust-srcNot affected
Red Hat Enterprise Linux 9rust-std-staticNot affected
Red Hat Enterprise Linux 9rust-std-static-wasm32-unknown-unknownNot affected
Red Hat Enterprise Linux 9rust-std-static-wasm32-wasiNot affected
Red Hat Enterprise Linux 9rust-std-static-wasm32-wasip1Not affected
Red Hat Enterprise Linux 9rust-toolsetNot affected
Red Hat Enterprise Linux 9rustfmtNot affected
Red Hat Enterprise Linux 8cargoNot affected
Red Hat Enterprise Linux 8cargo-docNot affected
Red Hat Enterprise Linux 8clippyNot affected
Red Hat Enterprise Linux 8rlsNot affected
Red Hat Enterprise Linux 8rustNot affected
Red Hat Enterprise Linux 8rust-analysisNot affected
Red Hat Enterprise Linux 8rust-analyzerNot affected
Red Hat Enterprise Linux 8rust-debugger-commonNot affected
Red Hat Enterprise Linux 8rust-docNot affected
Red Hat Enterprise Linux 8rust-gdbNot affected
Red Hat Enterprise Linux 8rust-lldbNot affected
Red Hat Enterprise Linux 8rust-srcNot affected
Red Hat Enterprise Linux 8rust-std-staticNot affected
Red Hat Enterprise Linux 8rust-std-static-wasm32-unknown-unknownNot affected
Red Hat Enterprise Linux 8rust-std-static-wasm32-wasiNot affected
Red Hat Enterprise Linux 8rust-toolsetNot affected
Red Hat Enterprise Linux 8rustfmtNot affected

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.