Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. llm
  4. ›
  5. CVE-2026-31236

CVE-2026-31236: llm CLI tool contains a code injection vulnerability via `--functions` command-line argument

May 12, 2026 (updated May 27, 2026)

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.

References

  • github.com/advisories/GHSA-g76p-4vg5-f4qh
  • github.com/simonw/llm
  • nvd.nist.gov/vuln/detail/CVE-2026-31236
  • www.notion.so/CVE-2026-31236-35d1e139318881a4a0f1fffcf671f7e3

Code Behaviors & Features

Detect and mitigate CVE-2026-31236 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions up to 0.27.1

Solution

Unfortunately, there is no solution available yet.

Impact 9.8 CRITICAL

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

Learn more about CVSS

Weakness

  • CWE-94: Improper Control of Generation of Code ('Code Injection')

Source file

pypi/llm/CVE-2026-31236.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 23 Jun 2026 12:23:41 +0000.