CVEvulnerability
CVE-2026-31236
9.8 CRITICAL
Official page ↗
- Status
- Awaiting Analysis
- Published
- 2026-05-12
- Last modified
- 2026-07-15
- Assigner
- [email protected]
- CVSS 3.1 (134c704f-9b21-4f2e-91b3-4a467353bcc0)
- 9.8 CRITICAL — CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- CVSS 3.1 (0b0ca135-0b70-47e7-9f44-1890c2a1c46c)
- 7.3 HIGH — CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
- Weaknesses
- CWE-94
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.
Related
Weakness · CWE (1)
- CWE-94 Improper Control of Generation of Code weakness
References
- https://github.com/simonw/llm github.com
- https://www.notion.so/CVE-2026-31236-35d1e139318881a4a0f1fffcf671f7e3 www.notion.so
- https://access.redhat.com/security/cve/CVE-2026-31236 access.redhat.com
- https://bugzilla.redhat.com/show_bug.cgi?id=2476636 bugzilla.redhat.com
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-31236.json security.access.redhat.com