Impact of CVE-2024-24576 Rust Standard Library Command Injection Vulnerability on Enterprise Vault.

book

Article ID: 100066768

calendar_today

Updated On:

Description

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 method. An attacker able to control the arguments passed to a spawned process could execute arbitrary shell commands by bypassing the escaping processing. 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 method, which in practice results in a mostly consistent way arguments are split. 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 the 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 the cmd.exe command,a solution could not be identified that would correctly escape arguments in all cases. To maintain the API guarantees, the robustness of the escaping code was improved, and the Command API was changed to return an InvalidInput error when it cannot safely escape an argument. This error will be made 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.

For more information about this vulnerability, see CVE-2024-24576.

Impact

Enterprise Vault as a product is not affected by this vulnerability as it does not use Rust anywhere in the product codebase. There is no mitigation required as there is no impact on the product.

 

Issue/Introduction

Impact of CVE-2024-24576 Rust Standard Library Command Injection Vulnerability on Enterprise Vault.

Additional Information

JIRA: CFT-6360