CVE-2023-44452: Glib Dynamic Spawn Argument Injection

Constructing shell command strings dynamically with `g_strdup_printf` and passing them to execution or parsing mechanisms like `g_shell_parse_argv` or `g_spawn_command_line_sync` is vulnerable to argument injection. An attacker can supply a filename starting with a dash (`-`) that will be interpreted as a command option, leading to arbitrary code execution.

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0C
greprules fetch cve-2023-44452-glib-dynamic-spawn-argument-injection --engine opengrep

Description

Constructing shell command strings dynamically with `g_strdup_printf` and passing them to execution or parsing mechanisms like `g_shell_parse_argv` or `g_spawn_command_line_sync` is vulnerable to argument injection. An attacker can supply a filename starting with a dash (`-`) that will be interpreted as a command option, leading to arbitrary code execution.