{"id":"CVE-2026-31236","kind":"vulnerability","aliases":["CVE-2026-31236","GHSA-g76p-4vg5-f4qh"],"related":[],"title":"llm CLI tool contains a code injection vulnerability via `--functions` command-line argument","description":"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.","summary":"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.","severity":"critical","cvss":9.8,"epss":0.00327,"exploited":false,"exploited_at":null,"products":[{"name":"llm","fixed":[],"affected":"<= 0.27.1","ecosystem":"pypi"}],"ecosystems":["pypi"],"tags":["ai-cli","ai-tooling","cwe-94","developer-machines","llm","python"],"not_affected_if":["no-untrusted-command-input","version-above-0.27.1"],"how_to_check":"- Run `llm --version` and compare against the affected range `<= 0.27.1`.\n- Check whether any scripts, shell aliases or CI jobs pass `--functions` with content from outside your team.","fix":"- `llm` fixed version: unknown; the sources list the affected range as thru 0.27.1 with no fixed version stated.","status":"open","published_at":"2026-05-12T18:16:51+00:00","first_seen_at":"2026-11-16T15:12:10+00:00","triaged_at":"2026-11-16T15:12:50+00:00","updated_at":"2026-11-16T15:37:59+00:00","category":"ai-tooling","confidence":0.8,"triage":{"at":"2026-11-16T15:12:50Z","model":"claude-haiku-5-5","output":{"fix":"- `llm` fixed version: unknown; the sources list the affected range as thru 0.27.1 with no fixed version stated.","reach":"local","title":"llm CLI: --functions argument runs attacker-supplied Python code via exec()","impact":"high","summary":"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.","audience":"developers","category":"ai-tooling","nicknames":[],"who_cares":["llm","python","ai-cli","developer-machines"],"confidence":0.8,"fix_status":"unknown","needs_auth":"no","worst_case":"Attacker runs arbitrary Python code as the user on the machine","analyst_note":"Confirm the fixed version of pypi:llm and whether a patched release exists; the GHSA page at https://github.com/advisories/GHSA-g76p-4vg5-f4qh is the source to check.","how_to_check":"- Run `llm --version` and compare against the affected range `<= 0.27.1`.\n- Check whether any scripts, shell aliases or CI jobs pass `--functions` with content from outside your team.","plain_action":"","product_name":"","needs_analyst":true,"not_affected_if":["version-above-0.27.1","no-untrusted-command-input"],"who_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.","user_interaction":"yes","product_ecosystem":"","needs_special_setup":"no","severity_if_unknown":"critical"},"cost_usd":0.000775,"input_tokens":4687,"output_tokens":613,"severity_before":"critical"},"analyst_status":null,"analyst_note":null,"search":"'-2026':16A,24A '-31236':17A,25A '-94':34B '0.27.1':95C '4vg5':21A 'ai':28B,31B 'ai-c':27B 'ai-tool':30B 'allow':114C 'arbitrari':81B,154C,175C 'argument':14A,49B,108C,110C,160C 'attack':69B,143C,186C 'check':57B 'cli':2A,29B,92C 'code':6A,61B,82B,99C,129C,156C,176C 'command':12A,43B,79B,106C,152C 'command-lin':11A,42B,105C 'contain':4A,96C 'control':89B,188C 'craft':77B,148C 'critic':98C 'custom':118C 'cve':15A,23A 'cwe':33B 'definit':121C 'develop':36B 'developer-machin':35B 'direct':125C 'engin':164C 'exec':54B,133C 'execut':83B,126C,177C 'exploit':145C 'f4qh':22A 'full':88B,187C 'function':10A,48B,104C,120C,134C,159C 'g76p':20A 'get':71B,80B 'ghsa':19A 'ghsa-g76p-4vg5-f4qh':18A 'given':62B 'grant':184C 'howev':122C 'inject':7A,100C 'intend':112C 'lead':173C 'line':13A,44B,107C 'llm':1A,26A,38B,41B,78B,91C,151C 'machin':37B,67B 'malici':150C 'pass':46B 'potenti':183C 'provid':117C,128C 'python':39B,52B,60B,119C,155C 'restrict':141C 'run':64B,75B,170C 'sandbox':138C 'sanit':137C 'secur':140C 'social':163C 'straight':50B 'system':182C 'thru':94C 'tool':3A,32B,45B,93C,124C 'trick':166C 'unsaf':132C 'use':130C,162C 'user':73B,86B,115C 'via':9A,102C 'victim':168C,180C 'vulner':8A,101C 'without':135C","nicknames":[],"mitigations":[],"who_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.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"unknown","audience":"developers","plain_action":null,"pkeys":["llm"],"ptokens":["llm"],"labels":["aicli","aitooling","critical","cwe94","developermachines","llm","pypi","python"],"campaign_type":null,"search_a":"'-2026':16A,24A '-31236':17A,25A '4vg5':21A 'argument':14A 'cli':2A 'code':6A 'command':12A 'command-lin':11A 'contain':4A 'cve':15A,23A 'f4qh':22A 'function':10A 'g76p':20A 'ghsa':19A 'ghsa-g76p-4vg5-f4qh':18A 'inject':7A 'line':13A 'llm':1A,26A 'tool':3A 'via':9A 'vulner':8A","search_b":"'-94':34B 'ai':28B,31B 'ai-c':27B 'ai-tool':30B 'arbitrari':81B 'argument':49B 'attack':69B 'check':57B 'cli':29B 'code':61B,82B 'command':43B,79B 'command-lin':42B 'control':89B 'craft':77B 'cwe':33B 'develop':36B 'developer-machin':35B 'exec':54B 'execut':83B 'full':88B 'function':48B 'get':71B,80B 'given':62B 'line':44B 'llm':38B,41B,78B 'machin':37B,67B 'pass':46B 'python':39B,52B,60B 'run':64B,75B 'straight':50B 'tool':32B,45B 'user':73B,86B","search_c":"'0.27.1':95C 'allow':114C 'arbitrari':154C,175C 'argument':108C,110C,160C 'attack':143C,186C 'cli':92C 'code':99C,129C,156C,176C 'command':106C,152C 'command-lin':105C 'contain':96C 'control':188C 'craft':148C 'critic':98C 'custom':118C 'definit':121C 'direct':125C 'engin':164C 'exec':133C 'execut':126C,177C 'exploit':145C 'full':187C 'function':104C,120C,134C,159C 'grant':184C 'howev':122C 'inject':100C 'intend':112C 'lead':173C 'line':107C 'llm':91C,151C 'malici':150C 'potenti':183C 'provid':117C,128C 'python':119C,155C 'restrict':141C 'run':170C 'sandbox':138C 'sanit':137C 'secur':140C 'social':163C 'system':182C 'thru':94C 'tool':93C,124C 'trick':166C 'unsaf':132C 'use':130C,162C 'user':115C 'via':102C 'victim':168C,180C 'vulner':101C 'without':135C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2026-05-12T18:16:51+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-g76p-4vg5-f4qh","url":"https://github.com/advisories/GHSA-g76p-4vg5-f4qh","severity":"critical","published_at":"2026-05-12T18:30:41+00:00","modified_at":"2026-11-16T15:10:55+00:00","first_seen_at":"2026-11-16T15:12:10+00:00","fetched_at":"2026-11-16T15:16:20+00:00","note":null},{"source":"nvd","external_id":"CVE-2026-31236","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31236","severity":null,"published_at":"2026-05-12T18:16:51+00:00","modified_at":"2026-07-15T02:19:46+00:00","first_seen_at":"2026-11-16T15:37:59+00:00","fetched_at":"2026-11-16T15:37:59+00:00","note":null}],"documents":[],"disclosures":[],"exploit_sources":[{"type":"epss","score":0.00327,"url":"https://api.first.org/data/v1/epss?cve=CVE-2026-31236"}],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}