cve.bz

CVE-2026-31236 Code Injection

9.8 criticalEPSS 0.3%

Critical (9.8). EPSS 0.3% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

CVSS 3.1

9.8 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
0.3% (unchanged from 0.3% a week ago; 0.5% 30 days ago) estimated probability of exploitation activity in the next 30 days; 26th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: yes · Technical impact: total, assessed 2026-05-14. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-94 Improper Control of Generation of Code (Code Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Awaiting analysis
Record from
the NVD, synced

Ask an AI about this CVE

Show the promptExplain CVE-2026-31236 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-31236?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-31236?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-31236 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-g76p-4vg5-f4qhPyPIllm<=0.27.1no fix published
PYSEC-2026-400PyPIllm<=0.27.1no fix published

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian13, 14llmno fix listedDEBIAN-CVE-2026-31236
Ubuntu25.10, 26.04:LTSllmno fix listedUBUNTU-CVE-2026-31236

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu.

Red Hat

Red Hat rates this Important.

Red Hat's statement

This flaw is rated as Important (CVSS 7.3) because the llm tool is a local command-line application, not a network-facing service (AV:L), and exploitation requires a local user with the tool installed (PR:L) to be socially engineered into executing a specially crafted command containing malicious Python code in the `--functions` argument (UI:R). Red Hat OpenShift AI (RHOAI) is not affected as the llm CLI tool is not present in RHOAI container images. Fedora ships the affected python-llm package. To reduce risk, users should run the llm tool inside a sandbox such as a container or VM. This is mainly informative.

Red Hat's mitigation

The `--functions` argument in the llm CLI tool executes arbitrary Python code by design, similar to `python -c`. There is no built-in sandboxing or restriction on the code that can be run. To reduce the risk of exploitation, run the llm process inside a sandbox such as a container or a VM.

ProductPackageStateAdvisory
Red Hat OpenShift AI (RHOAI)rhoai/odh-model-controller-rhel9Not affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-31236.

Attack patterns (CAPEC)

  • CAPEC-35 Leverage Executable Code in Non-Executable Files Likelihood: High · Severity: Very High
  • CAPEC-77 Manipulating User-Controlled Variables Likelihood: High · Severity: Very High
  • CAPEC-242 Code Injection Likelihood: High · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON