CVE-2026-31236: llm CLI tool contains a code injection vulnerability via `--functions` command-line argument
Affects llmSource GCVE Database
Not known to be exploited · CVSS 9.8 Critical.
Data as of 16 Nov 2026, 15:20 UTC
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HExploitation evidence
Disclosed: evidence found.
CVE published 12 May 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 15 Nov 2026.
What to do
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| PyPIllm | Affected
| Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
To mitigate the risk, users should run the llm CLI tool inside a sandboxed environment such as a container or virtual machine to isolate potential malicious code execution. Avoid running untrusted commands with the --functions argument and educate users about the risks of executing commands from untrusted sources.
Description
The llm CLI tool up to version 0.27.1 contains a critical code injection vulnerability via its --functions command-line argument. This argument allows users to provide custom Python code, which the tool executes directly using exec() without any sanitization or sandboxing. An attacker can exploit this by tricking a user into running a malicious command, leading to arbitrary code execution and potentially full system compromise. The vulnerability requires local access and user interaction to execute the crafted command. Red Hat rates this flaw as Important due to its local attack vector and required user interaction. No official patch is currently available, but running the tool inside a sandbox such as a container or VM is recommended to mitigate risk.
References
- nvd.nist.gov/vuln/detail/CVE-2026-31236 (opens in a new tab)
- access.redhat.com/security/cve/CVE-2026-31236 (opens in a new tab)
- bugzilla.redhat.com/show_bug.cgi?id=2476636 (opens in a new tab)
- github.com/pypa/advisory-database/tree/main/vulns/llm/PYSEC-2026-400.yaml (opens in a new tab)
- github.com/simonw/llm (opens in a new tab)
- pypi.org/project/llm (opens in a new tab)
- security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-31236.json (opens in a new tab)
- notion.so/CVE-2026-31236-35d1e139318881a4a0f1fffcf671f7e3 (opens in a new tab)