Skip to content
OpenAdvisories
Critical · 9.8 CVE-2026-31236 EUVD-2026-29559GHSA-g76p-4vg5-f4qhPYSEC-2026-400

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

Published May 12, 2026 · Updated Jul 15, 2026 · Assigned by mitre

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.

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 llm No fix yet —
Debian 13 llm No fix yet —
ReleasePackageFixed inAdvisory
Ubuntu 26.04 LTS llm No fix yet —
Ubuntu 25.10 llm No fix yet —

Affected packages

EcosystemPackageAffectedFixedRecord
PyPI llm <= 0.27.1 — GHSA-g76p-4vg5-f4qh

References