# CVE-2024-58266: Multiple issues involving quote API in shlex

> Attackers can inject commands via unquoted special characters in the shlex Rust library, potentially leading to code execution.

- **Severity:** Low 3.2 (`CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:N/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 27 Jul 2025
- **Updated:** 28 Jul 2025
- **Also known as:** AZL-66008, AZL-66017, AZL-66029, AZL-66035, DEBIAN-CVE-2024-58266, GHSA-r7qv-8r2h-pg27, RUSTSEC-2024-0006, SUSE-SU-2025:03077-1, SUSE-SU-2025:03092-1, UBUNTU-CVE-2024-58266

## What is CVE-2024-58266?

CVE-2024-58266 is a low-severity command injection vulnerability in comex shlex, published on 27 Jul 2025. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

The shlex crate before 1.2.1 for Rust allows unquoted and unescaped instances of the { and \xa0 characters, which may facilitate command injection.

Weakness: CWE-116 (Improper Encoding or Escaping of Output)

## Which versions are affected by CVE-2024-58266?

3 open source packages ship an affected version, including shlex. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `shlex` | crates.io | All versions | 1.3.0 |
| `shlex` | crates.io | All versions | 1.3.0 |
| `shlex` | crates.io | From 0.0.0-0 | 1.3.0 |
| `rav1e` | SUSE:Linux Enterprise Module for Basesystem 15 SP6 | All versions | 0.6.6-150600.3.6.1 |
| `rav1e` | SUSE:Linux Enterprise Module for Basesystem 15 SP7 | All versions | 0.6.6-150600.3.6.1 |
| `rav1e` | openSUSE:Leap 15.6 | All versions | 0.6.6-150600.3.6.1 |

Products: Comex Shlex.

## How do I fix CVE-2024-58266?

Upgrade shlex to 1.3.0 or later.

## Is CVE-2024-58266 being exploited?

There is no known exploitation of CVE-2024-58266 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-58266 and fix it if it is affected.

What it is: CVE-2024-58266 is a low-severity command injection vulnerability in comex shlex, published on 27 Jul 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-58266 in the wild and no public exploit code.

Affected packages and fixed versions:
- shlex (crates.io): affected all versions; fixed in 1.3.0
- shlex (crates.io): affected all versions; fixed in 1.3.0
- shlex (crates.io): affected from 0.0.0-0; fixed in 1.3.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-58266/ (Markdown: https://insights.sbomify.com/CVE-2024-58266/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-58266
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-58266
- OSV: https://osv.dev/vulnerability/CVE-2024-58266

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-58266/
Summaries are generated and may contain mistakes; the official description above is the record.
