Skip to main content

llm CLI tool CVE-2026-31236

| EUVDEUVD-2026-29559 CRITICAL
Code Injection (CWE-94)
2026-05-12 mitre GHSA-g76p-4vg5-f4qh
9.8
CVSS 3.1 · Vendor: mitre
Share

Severity by source

Vendor (mitre) PRIMARY
9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Red Hat
7.3 HIGH
qualitative

Primary rating from Vendor (mitre).

CVSS VectorVendor: mitre

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

4
Analysis Generated
May 14, 2026 - 20:23 vuln.today
CVSS changed
May 14, 2026 - 20:22 NVD
9.8 (CRITICAL)
CVE Published
May 12, 2026 - 00:00 nvd
CRITICAL 9.8
CVE Published
May 12, 2026 - 00:00 nvd
UNKNOWN (no severity yet)

DescriptionCVE.org

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.

AnalysisAI

Arbitrary code execution occurs in the llm CLI tool (versions through 0.27.1) when attackers social-engineer victims into running crafted commands containing malicious Python code in the --functions argument. The tool directly executes this code via unsafe exec() without sanitization, enabling full system compromise. CVSS 9.8 assigns network attack vector and no authentication, but real-world exploitation requires local command execution by a tricked user, creating a significant disparity between the vector and actual attack prerequisites. EPSS score of 0.02% (5th percentile) suggests minimal automated exploitation risk, and no active exploitation or public POC has been identified at time of analysis.

Technical ContextAI

The llm CLI tool is a command-line interface for interacting with large language models. The vulnerability stems from CWE-94 (Improper Control of Generation of Code), where the --functions argument accepts user-supplied Python function definitions intended for extending the tool's capabilities. The implementation uses Python's exec() function to evaluate this input directly in the application's runtime context without input validation, AST sanitization, or restricted execution environments (no use of RestrictedPython, sandboxing via subprocess isolation, or capability restrictions). This design flaw allows arbitrary Python code execution with the privileges of the user running the llm command. The CPE data shows 'n/a:n/a', indicating incomplete vendor/product taxonomy in vulnerability databases, though GitHub references confirm the affected product is simonw/llm.

RemediationAI

Upgrade to llm CLI tool version 0.27.2 or later if available, verifying fix status at the official GitHub repository (github.com/simonw/llm) and the vendor's Notion advisory page. As of this analysis, no specific patch version has been independently confirmed from vendor advisories - organizations must monitor the GitHub releases page for security updates. If immediate patching is not feasible, implement these specific compensating controls: (1) Disable or restrict the --functions argument through wrapper scripts that filter this parameter before executing llm commands, noting this breaks legitimate custom function use cases; (2) Educate users never to execute llm commands from untrusted sources including AI-generated suggestions, forum posts, or documentation without manual code review of all arguments; (3) Deploy application control policies (AppLocker, SELinux) to restrict llm execution to approved scripts only, which may reduce workflow flexibility; (4) Run llm commands in isolated containers or VMs with minimal privileges, accepting the operational overhead of containerized workflows. Long-term architectural fix requires the llm project to implement AST-based code validation, restricted execution contexts using Python's compile() with limited builtins, or subprocess isolation for function evaluation.

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2026-55255 HIGH POC
8.4 Jun 19

Cross-user flow execution in Langflow (< 1.9.1) lets any authenticated API-key holder run another user's flow by passing

Vendor StatusVendor

Share

CVE-2026-31236 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy