CVE-2026-31236
9.8critical
llm CLI tool contains a code injection vulnerability via `--functions` command-line argument
- Severity
- 9.8critical CVSS:3.1 by CISA-ADP
- Exploit likelihood
- 0.33% (higher than 27% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-g76p-4vg5-f4qhPYSEC-2026-400
Description
The llm CLI tool thru 0.27.1 contains a critical code injection vulnerability via its --functions command-line argument. This argument is intended to allow users to provide custom Python function definitions. However, the tool directly executes the provided code using the unsafe exec() function without any sanitization, sandboxing, or security restrictions. An attacker can exploit this by crafting a malicious llm command with arbitrary Python code in the --functions argument and using social engineering to trick a victim into running it. This leads to arbitrary code execution on the victim's system, potentially granting the attacker full control.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| rhoai/odh-model-controller-rhel9 | Not specified | CVE List |
| llm (PyPI) | up to 0.27.1 | GitHub Advisory Database, PyPA Advisory Database |
All scores
| CISA-ADP | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| redhat-SADP | 7.3high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H |
| GitHub | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| PyPA Advisory Database | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-31236 changed 2026-07-15 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-g76p-4vg5-f4qh changed 2026-11-16 | CC-BY-4.0 |
| NVD | CVE-2026-31236 changed 2026-07-15 | Public domain |
| PyPA Advisory Database | PYSEC-2026-400 changed 2026-07-01 | CC-BY-4.0 |