CVE-2026-31236
CRITICAL 9.8CVSS 3.1llm CLI tool contains a code injection vulnerability via `--functions` command-line argument
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.
- Published
- 12 May 2026
- Last modified
- 16 Nov 2026
- Assigned by
- cve@mitre.org
- NVD status
- Awaiting Analysis
- Weakness
- CWE-94
- Also known as
- GHSA-g76p-4vg5-f4qhPYSEC-2026-400
- Sources
- NVDJSONOSV GHSA-g76p-4vg5-f4qhJSONOSV PYSEC-2026-400JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | 134c704f-9b21-4f2e-91b3-4a467353bcc0 (Secondary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | PyPA | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 0b0ca135-0b70-47e7-9f44-1890c2a1c46c (Secondary) | CVSS 3.1 | HIGH 7.3 | CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | PyPI | llm | <= 0.27.1 |
References
- https://github.com/simonw/llm · PACKAGE
- https://www.notion.so/CVE-2026-31236-35d1e139318881a4a0f1fffcf671f7e3 · WEB
- https://access.redhat.com/security/cve/CVE-2026-31236 · WEB
- https://bugzilla.redhat.com/show_bug.cgi?id=2476636 · WEB
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-31236.json · WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-31236 · ADVISORY
- https://github.com/pypa/advisory-database/tree/main/vulns/llm/PYSEC-2026-400.yaml · WEB
- https://pypi.org/project/llm · WEB, PACKAGE
- https://github.com/advisories/GHSA-g76p-4vg5-f4qh · ADVISORY
History
- 25 Nov 2026 21:02 UTC · NVD: first stored (published 12 May 2026)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 29 Jun 2026)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 12 May 2026)