---
title: "CVE-2026-31236: llm CLI tool contains a code injection vulnerability via `--functions` command-line argument"
url: https://erroneo.us/security/cve/CVE-2026-31236/
description: "CVE-2026-31236 (llm (PyPI)): The llm CLI tool thru 0.27.1 contains a critical code injection vulnerability via its --functions command-line argument. This…"
type: vulnerability-record
section: "Security Digest"
date_published: 2026-05-12
date_modified: 2026-07-15
publisher: erroneo.us
author: erroneo.us Security Desk
cve: "CVE-2026-31236"
kev: false
cvss: 7.3
epss: 0.00462
license: All rights reserved. Quote with attribution and a link.
---

# CVE-2026-31236: llm CLI tool contains a code injection vulnerability via `--functions` command-line argument

**Signal:** Normal patch cycle. No exploitation signal; fix it in your next routine update if you are affected. (Computed from CISA KEV, EPSS and CVSS; not an editorial verdict.)

## Should you act?

- No confirmed exploitation. It is not in CISA’s KEV catalog and CISA’s SSVC assessment records no known exploitation. That can change quickly after a public write-up; re-check if you are affected.
- EPSS 0.5% , percentile 39: FIRST’s model estimates a 0.5% chance of exploitation activity in the next 30 days, higher than 39% of all scored CVEs (low). EPSS is a probability, not a verdict.
- Needs local access needed. Lower urgency for most teams unless an attacker could already run code on the machine.
- Only applies if your dependency tree includes llm (PyPI) <= 0.27.1, no fixed version listed . Check your lockfile, including transitive dependencies.

## What it is

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.

## Affected packages

- PyPI `llm` <= 0.27.1 → fixed: none listed

## Affected products (CVE record)

- n/a n/a: see advisory

## Severity

- CISA-ADP CVSS 3.1: 9.8 `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- redhat-SADP CVSS 3.1: 7.3 `CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H`
- GitHub CVSS 3.1: 9.8 `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## Exploitation

- CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
- CISA SSVC assessment: exploitation none , automatable yes , technical impact total .
- FIRST EPSS (model of 2026-10-21): 0.46% probability of exploitation activity in the next 30 days; percentile 39.

## Sources

- [GitHub Advisory GHSA-g76p-4vg5-f4qh](https://github.com/advisories/GHSA-g76p-4vg5-f4qh)
- [CVE.org record CVE-2026-31236](https://www.cve.org/CVERecord?id=CVE-2026-31236)
- [NVD entry CVE-2026-31236](https://nvd.nist.gov/vuln/detail/CVE-2026-31236)
- [github.com](https://github.com/simonw/llm)
- [notion.so](https://www.notion.so/CVE-2026-31236-35d1e139318881a4a0f1fffcf671f7e3)
- [access.redhat.com](https://access.redhat.com/security/cve/CVE-2026-31236)
- [RHBZ#2476636](https://bugzilla.redhat.com/show_bug.cgi?id=2476636)
- [security.access.redhat.com](https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-31236.json)

---
Source page: https://erroneo.us/security/cve/CVE-2026-31236/ · Security Digest: https://erroneo.us/security/ · More: https://erroneo.us/llms.txt
