Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%
Get alerts for future matching vulnerabilitiesLog in to subscribe
I. Basic Information for CVE-2024-24576
Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
Rusts's `std::process::Command` did not properly escape arguments of batch files on Windows
Source: NVD (National Vulnerability Database)
Vulnerability 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.
Source: NVD (National Vulnerability Database)
CVSS Information
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Source: NVD (National Vulnerability Database)
Vulnerability Type
OS命令中使用的特殊元素转义处理不恰当(OS命令注入)
Source: NVD (National Vulnerability Database)
Vulnerability Title
Rust 安全漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
Rust是美国Mozilla基金会的一款通用、编译型编程语言。 Rust 1.77.2之前版本存在安全漏洞,该漏洞源于没有正确转义Windows上批处理文件的参数,攻击者可以通过绕过转义来执行任意shell命令。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)
Affected Products
VendorProductAffected VersionsCPESubscribe
rust-langrust < 1.77.2 -
II. Public POCs for CVE-2024-24576
#POC DescriptionSource LinkShenlong Link
1Example of CVE-2024-24576 use case.https://github.com/frostb1ten/CVE-2024-24576-PoCPOC Details
2Nonehttps://github.com/brains93/CVE-2024-24576-PoC-PythonPOC Details
3CVE-2024-24576 Proof of Concepthttps://github.com/aydinnyunus/CVE-2024-24576-ExploitPOC Details
4CVE-2024-24576 PoC for Nim Langhttps://github.com/foxoman/CVE-2024-24576-PoC---NimPOC Details
5This is a simple demo for the BadBatBut vulnerability CVE-2024-24576https://github.com/corysabol/batbadbut-demoPOC Details
6https://nvd.nist.gov/vuln/detail/CVE-2024-24576https://github.com/mishalhossin/CVE-2024-24576-PoC-PythonPOC Details
7CVE-2024-24576 PoC in Juliahttps://github.com/lpn/CVE-2024-24576.jlPOC Details
8Nonehttps://github.com/Gaurav1020/CVE-2024-24576-PoC-RustPOC Details
9PoC for CVE-2024-24576 vulnerability "BatBadBut"https://github.com/SheL3G/CVE-2024-24576-PoC-BatBadButPOC Details
10a python proof of concept for cve-2024-24576https://github.com/p14t1num/cve-2024-24576-pythonPOC Details
11https://nvd.nist.gov/vuln/detail/CVE-2024-24576https://github.com/mishl-dev/CVE-2024-24576-PoC-PythonPOC Details
12Example of CVE-2024-24576 use case.https://github.com/nasa-frostb1te/CVE-2024-24576-PoCPOC Details
AI-Generated POCPremium

No public POC found.

Login to generate AI POC
III. Intelligence Information for CVE-2024-24576
Please Login to view more intelligence information
IV. Related Vulnerabilities
V. Comments for CVE-2024-24576

No comments yet


Leave a comment