🤬
  • ■ ■ ■ ■ ■
    README.md
    1 1  # CVE-2024-24576 PoC
     2 + 
     3 + 
     4 +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.
     5 + 
     6 +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.
     7 + 
     8 +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.
     9 + 
     10 + 
    2 11  Running the main.rs file with the following payloads give
    3 12   
    4 13  ```
    skipped 30 lines
    35 44   
    36 45  Note the escaped argument with the " whoami
    37 46   
    38  - 
     47 +NOT MY FINDING!
    39 48   
    40  -NOT MY FINDING! Got information from https://www.bleepingcomputer.com/news/security/critical-rust-flaw-enables-windows-command-injection-attacks/
     49 +Sources:
     50 +https://github.com/rust-lang/rust/security/advisories/GHSA-q455-m56c-85mh
     51 +https://www.bleepingcomputer.com/news/security/critical-rust-flaw-enables-windows-command-injection-attacks/
    41 52   
Please wait...
Page is in error, reload to recover