CVE-2026-31236

Published May 12, 2026 CVSS 3.1 · 9.8 Critical EPSS < 1% KEV · Not listed
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-g76p-4vg5-f4qh llm CLI tool contains a code injection vulnerability via `--functions` command-line argument
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Title Python Code Injection via llm CLI --functions Argument
Type Values Removed Values Added
Metrics cvssV3_1

{'score': 9.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}

Type Values Removed Values Added
First Time appeared Simonw
Simonw llm
Vendors & Products Simonw
Simonw llm
Type Values Removed Values Added
Title Python Code Injection via llm CLI --functions Argument
Weaknesses CWE-94
Type Values Removed Values Added
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.
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
mitre
Published
Updated
Jul 15, 2026, 1:09 AM
Reserved
Mar 9, 2026, 12:00 AM
Status
Awaiting Analysis
Published
May 12, 2026, 6:16 PM
Modified
Jul 15, 2026, 2:19 AM