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
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Lifecycle Timeline
4DescriptionCVE.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.
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.
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
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
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
Cross-user flow execution in Langflow (< 1.9.1) lets any authenticated API-key holder run another user's flow by passing
Same weakness CWE-94 – Code Injection
View allSame technique Code Injection
View allVendor StatusVendor
Share
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-29559
GHSA-g76p-4vg5-f4qh