llamaCVEVulnerability Intelligence
/
rust

CVE-2024-24576

Rusts's std::process::Command did not properly escape arguments of batch files on Windows

Crítica · EPSS ≥ 10 %Parche disponibleOS command injection
Descargar PNG JSON
CVSS 3.1
10.0
Crítica
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H Fuente: CNA
ExplotaciónPoC públicaSSVC: poc · no figura en CISA KEV
Exploits públicos81 fuente
Parche1 versión1.77.2
Exposición953 dDesde la divulgación, 9 abr 2024, 12:28 p. m.
EPSS ≥ 10 %16 nov 2026Fecha en que la probabilidad de explotación superó el umbral
Decisión SSVCAtender
Priorizar en el próximo ciclo de cambios
Existe PoC pública, automatizable e impacto técnico total. Hay versiones corregidas disponibles.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Evaluación SSVC
Modificada
Explotación
Umbral EPSS
Remediación
Monitoreo
Detectada
9 abr 24
26 feb 25
4 nov 25
16 nov 26
17 nov 26
19 nov 26
9 abr 24
4 dic 24
30 jul 25
26 mar 26
19 nov 26
FechaFaseEventoDetalle
Divulgación Publicada CVE-2024-24576 divulgada · CVSS 10 (CNA)
Divulgación Evaluación SSVC CISA-ADP · explotación PoC pública
Divulgación Modificada Última actualización del registro
Explotación Umbral EPSS La probabilidad de explotación supera el 10 %
Monitoreo Detectada Ingresó al índice
Resumen

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.

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · CNA
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:L
BajaAlta
PrivilegiosPR:N
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:C
CambiadoSin cambio
ConfidencialidadC:H
AltoBajoNinguno
IntegridadI:H
AltoBajoNinguno
DisponibilidadA:H
AltoBajoNinguno
Versiones

Rangos afectados

Afectada Corregida
rust< 1.77.2
1.77.2
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
rust
Corregida 1.77.2 — —
Versiones corregidas1.77.2
Explotación

Arsenal público

Exploit-DB
—
0
Metasploit
—
0
Nuclei
—
0
PoC en GitHub
Gaurav1020/CVE-2024-24576-PoC-Rust · SheL3G/CVE-2024-24576-PoC-BatBadBut · aydinnyunus/CVE-2024-24576-Exploit · brains93/CVE-2024-24576-PoC-Python · federiconbaez/cortex9-rust-batbadbut-args-model · foxoman/CVE-2024-24576-PoC---Nim …
8
Ver los 8 repositorios de GitHub
Gaurav1020/CVE-2024-24576-PoC-Rust
SheL3G/CVE-2024-24576-PoC-BatBadBut
aydinnyunus/CVE-2024-24576-Exploit
brains93/CVE-2024-24576-PoC-Python
federiconbaez/cortex9-rust-batbadbut-args-model
foxoman/CVE-2024-24576-PoC---Nim
frostb1ten/CVE-2024-24576-PoC
lpn/CVE-2024-24576.jl

Los repositorios públicos incluyen exploits, escáneres, laboratorios y reglas de detección. No ejecute código de terceros sin revisarlo en un entorno aislado.

Referencias
Fabricantehttps://github.com/rust-lang/rust/security/advisories/GHSA-q455-m56c-85mh
Análisishttp://www.openwall.com/lists/oss-security/2024/04/09/16
Exploithttps://github.com/Gaurav1020/CVE-2024-24576-PoC-Rust
Exploithttps://github.com/SheL3G/CVE-2024-24576-PoC-BatBadBut
Exploithttps://github.com/aydinnyunus/CVE-2024-24576-Exploit
Exploithttps://github.com/brains93/CVE-2024-24576-PoC-Python
Exploithttps://github.com/federiconbaez/cortex9-rust-batbadbut-args-model
Exploithttps://github.com/foxoman/CVE-2024-24576-PoC---Nim
Exploithttps://github.com/frostb1ten/CVE-2024-24576-PoC
Exploithttps://github.com/lpn/CVE-2024-24576.jl
Otrahttps://doc.rust-lang.org/std/io/enum.ErrorKind.html#variant.InvalidInput
Otrahttps://doc.rust-lang.org/std/os/windows/process/trait.CommandExt.html#tymethod.raw_arg
Ver 9 referencias más
Otrahttps://doc.rust-lang.org/std/process/struct.Command.html
Otrahttps://doc.rust-lang.org/std/process/struct.Command.html#method.arg
Otrahttps://doc.rust-lang.org/std/process/struct.Command.html#method.args
Otrahttps://github.com/rust-lang/rust/issues
Otrahttps://www.rust-lang.org/policies/security
Otrahttps://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/W7WRFOIAZXYUPGXGR5UEEW7VTTOD4SZ3/
Otrahttps://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/RPH3PF7DVSS2LVIRLW254VWUPVKJN46P/
Otrahttps://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/N323QAEEUVTJ354BTVQ7UB6LYXUX2BCL/
Otrahttps://www.kb.cert.org/vuls/id/123335

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.