LiveActive security incident?Get immediate response
CVE Record

CVE-2026-31236: The llm CLI tool thru 0.27.1 contains a critical code injection vulnerability via its --functions command-l...

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.

CriticalCVSS 9.8Not KEV-listedUpdated
Glexia's TakeAutomated analysiscritical

Security readout for executives and security teams

Plain-English summary

This CVE describes arbitrary code execution in the llm CLI through 0.27.1. A malicious command using --functions can cause Python code to run on a victim system. The source describes social engineering as the likely path. No cited source confirms active exploitation.

Executive priority

Prioritize this for environments where staff use llm CLI with copied commands or automation. The impact is potentially full system compromise, but the available evidence does not show confirmed active exploitation or a named fix.

Technical view

The issue is CWE-94 code injection. The --functions argument is intended for custom Python functions, but the tool executes supplied code with unsafe exec() without sanitization, sandboxing, or restrictions. Successful abuse can affect confidentiality, integrity, and availability on the local system running the command.

Likely exposure

Exposure is most likely among developers, automation hosts, CI runners, or operations workstations using llm CLI through 0.27.1, especially where users run copied commands or shared scripts containing --functions.

Exploitation context

The bundle marks KEV as false. The description says exploitation depends on tricking a victim into running a malicious llm command, while the CVSS vector lists UI:N. Treat exploitation evidence as incomplete and do not assume active attacks.

Researcher notes

Key gaps remain: affected product metadata is sparse, no patch version is named, and exploitation prerequisites conflict between narrative text and CVSS UI:N. Validate against upstream llm behavior and official advisories before broad claims.

Mitigation direction

  • Inventory llm CLI installations and identify versions through 0.27.1.
  • Avoid running untrusted llm commands, especially those using --functions.
  • Restrict llm usage in CI and shared scripts to reviewed, trusted inputs.
  • Monitor the project, CVE record, and vendor advisories for confirmed fixes.
  • Remove or isolate vulnerable installations where business need is low.

Validation and detection

  • Check developer endpoints, build hosts, and containers for installed llm CLI versions.
  • Search approved scripts and CI definitions for llm commands using --functions.
  • Review recent shell history and endpoint telemetry for suspicious llm usage.
  • Confirm whether security tools alert on unexpected Python execution from llm.
  • Track Red Hat and upstream status for product impact and remediation updates.
Prepared
Confidence
medium
Sources
7

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · medium confidence lookup

CWE-94: Code execution behavior lookup

Code execution and unsafe deserialization weaknesses often justify reviewing execution behavior and process telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
description · low confidence lookup

Execution behavior lookup

The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2026-31236 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
Critical
CVSS
9.8 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

2CVSS vectors
5Timeline events
2ADP providers
6Source links

SSVC decision data

CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: yesTechnical Impact: total

CVSS vector scores

2 official scores

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
9.8CVSS 3.1CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H3.95.9CISA-ADP
7.3CVSS 3.1HighCVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H1.35.9redhat-SADP

Vulnerability scoring details

Base CVSS 3.1 score

9.8Critical
CVSS 3.1 vector shape for CVE-2026-31236Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone

Vulnerability timeline

Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.

  1. CVE reservedCVE Program

    The CVE ID was reserved by the assigning CNA.

  2. ADP timelineredhat-SADP

    Made public.

  3. CVE publishedCVE Program

    The CVE record was published.

  4. ADP timelineredhat-SADP

    Reported to Red Hat.

  5. CVE updatedCVE Program

    The CVE record metadata indicates this as the latest update time.

ADP provider summaries

CISA-ADPCISA ADP Vulnrichment
cvssV3_1other:ssvc
redhat-SADPllm: llm CLI tool: Arbitrary code execution via code injection in --functions argument
other:Red Hat severity ratingcvssV3_1
  • 2026-05-12T18:04:06.382Z: Reported to Red Hat.
  • 2026-05-12T00:00:00.000Z: Made public.

Source materials

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
n/an/an/aListed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-94 · source CWE mapping

Improper Control of Generation of Code ('Code Injection')

Improper Control of Generation of Code ('Code Injection') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.