PYSEC-2026-400

Vulnerability from pysec - Published: 2026-06-29 11:50 - Updated: 2026-07-01 20:22
VLAI
Details

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.

Impacted products
Name purl
llm pkg:pypi/llm

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "llm",
        "purl": "pkg:pypi/llm"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "last_affected": "0.27.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ],
      "versions": [
        "0.1",
        "0.10",
        "0.10a0",
        "0.10a1",
        "0.11",
        "0.11.1",
        "0.11.2",
        "0.12",
        "0.13",
        "0.13.1",
        "0.14",
        "0.15",
        "0.16",
        "0.17",
        "0.17.1",
        "0.17a0",
        "0.18",
        "0.18a0",
        "0.18a1",
        "0.19",
        "0.19.1",
        "0.19a0",
        "0.19a1",
        "0.19a2",
        "0.2",
        "0.20",
        "0.21",
        "0.22",
        "0.23",
        "0.23a0",
        "0.24",
        "0.24.1",
        "0.24.2",
        "0.24a0",
        "0.24a1",
        "0.25",
        "0.25a0",
        "0.26",
        "0.26a0",
        "0.26a1",
        "0.27",
        "0.27.1",
        "0.3",
        "0.4",
        "0.4.1",
        "0.5",
        "0.6",
        "0.6.1",
        "0.7",
        "0.7.1",
        "0.8",
        "0.8.1",
        "0.9",
        "0.9a0",
        "0.9a1"
      ]
    }
  ],
  "aliases": [
    "CVE-2026-31236",
    "GHSA-g76p-4vg5-f4qh"
  ],
  "details": "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\u0027s system, potentially granting the attacker full control.",
  "id": "PYSEC-2026-400",
  "modified": "2026-07-01T20:22:56.637769Z",
  "published": "2026-06-29T11:50:49.759860Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-31236"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/simonw/llm"
    },
    {
      "type": "WEB",
      "url": "https://www.notion.so/CVE-2026-31236-35d1e139318881a4a0f1fffcf671f7e3"
    },
    {
      "type": "PACKAGE",
      "url": "https://pypi.org/project/llm"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/advisories/GHSA-g76p-4vg5-f4qh"
    }
  ],
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "llm CLI tool contains a code injection vulnerability via `--functions` command-line argument"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…