Overview of CVE-2024-24576

On 9 April 2024, the Rust Team released Rust version 1.77.2 to address CVE-2024-24576. The vulnerability relates to the Rust Standard Library’s handling of arguments passed to cmd.exe when invoking batch (*.bat) files and is isolated to Windows operating systems.

This CVE received a CVSS score of 10.0, but there are specific conditions that must be met for this vulnerability to be applicable to your environment. Having older releases of the Rust tooling installed on a developer machine, or an application written in Rust compiled against an older release of Rust does not inherently mean the endpoint is at risk to this CVE.

What is Rust?

Rust is a memory-safe, fast, and performant programming language with version 1.0 released in 2015.  The syntax is reminiscent of C and C++ and is interoperable with existing C/C++ libraries. Rust has the memory safety features that are lacking in C and C++ that have contributed to many memory-related vulnerabilities, such as buffer overflows. Applications written in Rust do not need a framework installed on endpoints.

Rust has grown in popularity and adoption, with increasing usage from software vendors such as Microsoft, Amazon, Google, and others. Memory safe languages have seen increased interest over the past year, due in part to the United States’ Cybersecurity and Infrastructure Security Agency’s (CISA) public push for memory safe language adoption.

Applicability: What does the CVSS 10.0 Rating Mean?

For an application to be vulnerable to CVE-2024-24576, there are specific requirements that must be met:

  • The application must be running on Windows.

  • The application, or its dependencies, must be compiled with Rust before version 1.77.2.

  • The application, or its dependencies, must call a batch file and allow untrusted user inputs to be passed as untrusted arguments using the Rust std::process:Command API call.

The technical details behind the flaw are documented here by the Rust Team. In brief, the vulnerability exists in the implementation of the command arguments APIs.  When a Rust application uses the Command::arg or Command::args API to pass arguments to cmd.exe on Windows a flaw in the argument escaping logic could allow arbitrary execution. This issue is unique to the Windows implementation and use of cmd.exe for batch files.

It is important to note that the Rust documentation states developers should utilize caution with untrusted inputs and has a note about *.bat file handling. We recommend Tanium customers monitor their applications for security updates to determine if any deployed applications are susceptible to this vulnerability and take appropriate action to mitigate or upgrade.