Security Digest · Vulnerability record
CVE-2026-31236: llm CLI tool contains a code injection vulnerability via `--functions` command-line argument
The llm CLI tool thru 0.27.1 contains a critical code injection vulnerability via its --functions command-line argument.
CVSS 7.3 High EPSS 0.5% · p39
Should you act?
Normal patch cycle
No exploitation signal; fix it in your next routine update if you are affected. This signal is computed from CISA KEV, EPSS and CVSS data; it is not an editorial verdict.
- 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.
From the GitHub advisory
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.
Weakness type: CWE-94.
Product: llm (PyPI) · Assigned by: mitre · Published: 2026-05-12
Affected and fixed versions
| Ecosystem | Package | Vulnerable | First fixed |
|---|---|---|---|
| PyPI | llm | <= 0.27.1 | none listed |
| Vendor | Product | Affected versions (per CVE record) |
|---|---|---|
| n/a | n/a | see vendor advisory |
Severity scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| CISA-ADP | 3.1 | 9.8 Critical | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| redhat-SADP | 3.1 | 7.3 High | CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H |
| GitHub | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
- Attack vector: local access needed
- Attack complexity: low
- Privileges required: low (any account)
- User interaction: required (a user must click/open something)
- Scope: unchanged
CVSS measures how bad a flaw is if exploited, not how likely exploitation is. Read it next to the exploitation data below.
Exploitation and urgency
- 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.
Timeline
- — CVE record published by mitre
- — GitHub-reviewed advisory GHSA-g76p-4vg5-f4qh published (critical)
- — CVE record last updated
Sources and references
Original sources first. Version and fix details should always be confirmed against the vendor or project advisory.
Vulnerability records
- GitHub Advisory GHSA-g76p-4vg5-f4qh github.com
- CVE.org record CVE-2026-31236 cve.org
- NVD entry CVE-2026-31236 nvd.nist.gov
Other references from the CVE record and advisory
- github.com github.com
- notion.so notion.so
- access.redhat.com access.redhat.com
- RHBZ#2476636 bugzilla.redhat.com
- security.access.redhat.com security.access.redhat.com