CVE-2026-31236
JSON

9.8critical

llm CLI tool contains a code injection vulnerability via `--functions` command-line argument

Severity
9.8critical CVSS:3.1 by CISA-ADP
Exploit likelihood
0.33% (higher than 27% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
mitre
Also known as
GHSA-g76p-4vg5-f4qhPYSEC-2026-400

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.

Affected

Product or packageVersionsReported by
Unspecified productn/aCVE List
rhoai/odh-model-controller-rhel9Not specifiedCVE List
llm (PyPI)up to 0.27.1GitHub Advisory Database, PyPA Advisory Database

All scores

CISA-ADP9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
redhat-SADP7.3high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
GitHub9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
PyPA Advisory Database9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-94

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-31236 changed 2026-07-15CVE Terms of Use
GitHub Advisory DatabaseGHSA-g76p-4vg5-f4qh changed 2026-11-16CC-BY-4.0
NVDCVE-2026-31236 changed 2026-07-15Public domain
PyPA Advisory DatabasePYSEC-2026-400 changed 2026-07-01CC-BY-4.0