Skip to content
DayZeroHub
Critical CVSS 9.8GHSA-g76p-4vg5-f4qhCVE-2026-31236

llm (PyPI): code injection via the --functions argument (CVE-2026-31236)

llm

Summary

The llm command-line tool, in versions up to and including 0.27.1, executes Python code supplied through the --functions argument without restrictions. The vulnerability is rated critical with a CVSS score of 9.8.

What happened

According to the description, the --functions argument lets users provide custom Python function definitions, but the tool runs that code directly with exec(), without sanitization, sandboxing or security restrictions (CWE-94, code injection). An attacker could craft an llm command containing arbitrary Python code in that argument and use social engineering to get a victim to run it. The result would be arbitrary code execution on the victim's system, potentially giving the attacker full control.

Why it matters

The CVSS 3.1 score is 9.8 (critical severity), with vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, as reported by GHSA. The described impact is arbitrary code execution on the machine of whoever runs the command. CISA's KEV catalog does not list this vulnerability as exploited; the source gives no indication of active exploitation.

Affected products and versions

Package llm (PyPI ecosystem), versions <= 0.27.1.

ProductVersionsFixed in
llm<= 0.27.1—

Action recommended by the source

The source does not state a fixed version or a vendor mitigation. See the references for advisory GHSA-g76p-4vg5-f4qh and the CVE-2026-31236 entry for updates.

Information taken from the source or the vendor. Verify it at the original link before acting.

Sources and references

Weaknesses (CWE): CWE-94

Relevant change history

  1. Published

    Advisory published.

Summary written with AI assistance from the source data. See the sources and references for complete information. View sources