Rust standard library vulnerable to arbitrary shell command execution
CVE-2024-24576

10CRITICAL

Key Information:

Vendor
Rust-lang
Status
Vendor
CVE Published:
9 April 2024

Badges

πŸ₯‡ Trended No. 1πŸ“ˆ TrendedπŸ“ˆ Score: 18,200πŸ‘Ύ Exploit Exists🟑 Public PoC🟣 EPSS 70%πŸ“° News Worthy

What is CVE-2024-24576?

CVE-2024-24576 is a critical vulnerability found in the Rust programming language's standard library prior to version 1.77.2. Rust is designed for system-level programming, emphasizing safety and performance. However, this vulnerability allows an attacker to execute arbitrary shell commands on Windows systems by improperly handling arguments passed to batch files. Organizations that rely on Rust for deploying applications, especially on Windows, face potential risks of malicious command execution, leading to unauthorized access and system compromise.

Technical Details

The vulnerability arises from the way the Rust standard library interacts with the Windows API when spawning processes. Specifically, the Command APIs in Rust, which are supposed to pass arguments securely without shell evaluation, were found to inadequately escape arguments for batch files (.bat and .cmd) on Windows. This shortcoming enables an attacker, who can control the input arguments, to bypass the intended safety measures, resulting in arbitrary command execution. Affected versions of the standard library fail to handle the unique argument parsing of cmd.exe, leading to the exploitation risk.

Impact of the Vulnerability

  1. Arbitrary Command Execution: Attackers can execute any shell command of their choice, potentially leading to unauthorized access, data manipulation, or system control.

  2. Compromise of System Integrity: Successful exploitation can lead to a complete compromise of the affected applications or systems, increasing the risk of further attacks or malware propagation.

  3. Risk to Application Reliability: The presence of this vulnerability could undermine the integrity and reliability of applications built with Rust, especially those handling untrusted input, necessitating immediate updates and security reviews to mitigate risks effectively.

Affected Version(s)

rust < 1.77.2

Exploit Proof of Concept (PoC)

PoC code is written by security researchers to demonstrate the vulnerability can be exploited. PoC code is also a key component for weaponization which could lead to ransomware.

News Articles

Command injection attacks likely with critical Rust vulnerability

Windows devices could be targeted with command injection attacks exploiting the maximum severity Rust standard library vulnerability, tracked as CVE-2024-24576, The Hacker News reports.

"BatBadBut" Vulnerability Discovered in Rust Standard Library on Windows - Cyber Kendra

"BatBadBut" Vulnerability Discovered in Rust Standard Library on Windows

Recent CVE-2024-24576 vulnerability on Rust could help run unauthorized commands

The vulnerability, flagged as CVE-2024-24576, will be gone in Rust version 1.77.2, as announced. What does it actually do?

References

EPSS Score

70% chance of being exploited in the next 30 days.

CVSS V3.1

Score:
10
Severity:
CRITICAL
Confidentiality:
High
Integrity:
High
Availability:
High
Attack Vector:
Network
Attack Complexity:
Low
Privileges Required:
None
User Interaction:
None
Scope:
Changed

Timeline

  • 🟑

    Public PoC available

  • πŸ‘Ύ

    Exploit known to exist

  • πŸ₯‡

    Vulnerability reached the number 1 worldwide trending spot

  • πŸ“ˆ

    Vulnerability started trending

  • πŸ“°

    First article discovered by BleepingComputer

  • Vulnerability published

  • Vulnerability Reserved

.