CVE-2024-58266
shlex: Shlex Command Injection Vulnerability
Severity
LowRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · July 27, 2025
Updated · September 18, 2026
Description
A flaw was found in shlex. The shlex crate improperly handles unquoted and unescaped curly brace and non-breaking space characters, allowing a local attacker to inject arbitrary commands. This injection occurs when processing input that contains these characters without proper quoting or escaping. Successful exploitation results in the execution of attacker-controlled commands. This can lead to arbitrary code execution.
Statement
This CVE was rated as Low severity. It involves three distinct issues: (1) Failure to quote characters, which can cause a single argument to be interpreted as multiple arguments in a shell, but does not directly allow arbitrary command execution; (2) Handling of null bytes in strings, which cannot be used in Unix command arguments or environment variables, making exploitation in typical environments unlikely; and (3) Lack of escaping for control characters in interactive shells, where writing control characters to the input of an interactive shell could cause misbehavior, though non-interactive shells are unaffected. Exploitation of these issues requires high attack complexity and targeting of uncommon scenarios. The overall impact is limited, and the affected scenarios are constrained in typical usage. Considering the high attack complexity, restricted exploitability, and limited impact, a Low severity rating is appropriate.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.
CVSS / CWE
CVSS 3.1 · 3.2CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:N/I:L/A:N
CWE-116 · Improper Encoding or Escaping of Output