CVE-2026-31236
published critical CVSS 3.1 · 9.8llm: llm CLI tool: Arbitrary code execution via code injection in --functions argument
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| n/a | — | n/an/a | Affected | Not stated | mitre |
| Red Hat | — | rhoai/odh-model-controller-rhel9Red Hat OpenShift AI (RHOAI) | Unaffected | Not required | redhat-SADP |
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.
A flaw was found in the llm CLI tool. An attacker can exploit a code injection vulnerability by crafting a malicious command with arbitrary Python code in the `--functions` argument. If a victim is tricked into running this command, it leads to arbitrary code execution on their system, potentially granting the attacker full control.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 9.8 / 10
- Severity
- critical
- Provider
- CISA-ADP · adp
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Additional Assessments
| Version | Score | Severity | Provider | Vector | Scenarios |
|---|---|---|---|---|---|
| 3.1 | 7.3 | high | redhat-SADP · adp | CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H | — |
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| n/a | n/a | n/a (affected) | mitre · cna |
| Red Hat | Red Hat OpenShift AI (RHOAI) | Default: unaffected | redhat-SADP · adp |
Weaknesses
3- n/a
- CWE-94 Improper Control of Generation of Code ('Code Injection')
- CWE-94 CWE-94 Improper Control of Generation of Code ('Code Injection')
References
5Provider assertions
3mitre · cna
redhat-SADP · adp
llm: llm CLI tool: Arbitrary code execution via code injection in --functions argument
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 39c428d9d844fa9b2c8308c27f95613bfe38675e1af4062cb241d3cbbfa57183
- Ingested
- 23 Sep 2026, 09:09:24 UTC
- Source record
- Official CVE record