LLM · CVE-2026-31236 · AI agents & MCP
NO FIX YET · SEE WHAT TO DO
The llm command-line tool passes its --functions argument straight into Python's exec() with no checks, so any Python code given there runs on the machine. An attacker who gets a user to run a crafted llm command gets arbitrary code execution with that user's full control.
first public May 12, 2026 · 2 sources
Check it with your coding agent
It reads this page and tells you if your code or app is affected.
Anyone who runs the llm CLI at version 0.27.1 or earlier, especially where commands are copied from untrusted sources or run in shared automation. Exposure depends on a user or script being tricked into running a crafted command; the sources do not say whether a default configuration is affected.
Not affected if no-untrusted-command-input, version-above-0.27.1
Who cares ai-cli, developer-machines, llm, python
llm --version and compare against the affected range <= 0.27.1.--functions with content from outside your team.llm fixed version: unknown; the sources list the affected range as thru 0.27.1 with no fixed version stated.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.
This page as .md · .json · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHub Advisory Database, CC-BY 4.0 · NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
InfraStack checks it against your stack and answers on your report, with the evidence and the fix.