CVE-2026-31236 json
llm CLI tool contains a code injection vulnerability via `--functions` command-line argument
published 2026-05-12 5 mo ago modified 2026-07-15 3 mo ago also GHSA-g76p-4vg5-f4qh , PYSEC-2026-400 , EUVD-2026-29559
- cvss
- 9.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.3%
- EPSS 0.3% chance of exploitation in 30 days, percentile 25%
- public exploits
- 0
- none known
Summary
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.
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2026-31236 updated cvss 7.3
llm: llm CLI tool: Arbitrary code execution via code injection in --functions argument
-
Red Hat OpenShift AI (RHOAI) rhoai/odh-model-controller-rhel9not affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- yes
- Technical impact
- total
- Assessed
- 5 mo ago
Exploit prediction
0.33% chance of exploitation in the next 30 days, higher than 25% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CISA ADP | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| CISA ADP | 3.1 | 7.3 | CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H |
| CNA | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| CNA | 3.1 | 7.3 | CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H |
| OSV | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | llm | <=0.27.1 |
no fix listed |
Affected products
- Red Hat Red Hat OpenShift AI (RHOAI)
Classification
- Weakness
-
- CWE-94 Improper Control of Generation of Code
References
-
github.com
/simonw/llm
package
-
notion.so
/CVE-2026-31236-35d1e139318881a4a0f1fffcf671f7e3
web
-
access.redhat.com
/security/cve/CVE-2026-31236
vdb-entry
-
bugzilla.redhat.com
/show_bug.cgi?id=2476636
issue-tracking
- security.access.redhat.com /data/csaf/v2/vex/2026/cve-2026-31236.json
-
nvd.nist.gov
/vuln/detail/CVE-2026-31236
advisory
-
pypi.org
/project/llm
package
-
github.com
/advisories/GHSA-g76p-4vg5-f4qh
advisory
Sources
- CVE List CVE-2026-31236
- GitHub Advisory GHSA-g76p-4vg5-f4qh
- NVD CVE-2026-31236
- OSV PYSEC-2026-400
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.