PatchSiren

PatchSiren cyber security CVE debrief

CVE-2026-31236 simonw CVE debrief

The llm CLI tool contains a critical code injection vulnerability via its --functions command-line argument. This argument allows users to provide custom Python function definitions but directly executes the provided code using the unsafe exec() function without 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, potentially granting the attacker full control.

Vendor
simonw
Product
llm
CVSS
CRITICAL 9.8
CISA KEV
Not listed in stored evidence
Original CVE published
2026-05-12
Original CVE updated
2026-11-16
Advisory published
2026-05-12
Advisory updated
2026-11-16

Who should care

Defenders responsible for systems using the llm CLI tool should assess exposure and prioritize patching or mitigation to prevent code injection attacks. This includes verifying the llm CLI tool version, applying patches or mitigations, and educating users on secure coding practices. Additionally, defenders should review compensating controls for exposed systems and monitor for suspicious activity related to the llm CLI tool.

Why it matters

The llm CLI tool vulnerability allows attackers to execute arbitrary code on victim systems, potentially granting full control. Defenders should prioritize verifying the llm CLI tool version, applying patches or mitigations, and educating users on secure coding practices.

  • Potential for arbitrary code execution on victim systems.
  • Possible granting of full control to attackers.
  • Need for verification of llm CLI tool versions and patching.
  • Importance of educating users on secure coding practices.

Technical summary

The llm CLI tool is vulnerable to code injection via the --functions command-line argument. This argument allows users to provide custom Python function definitions but executes the provided code using the unsafe exec() function without sanitization, sandboxing, or security restrictions. This vulnerability allows attackers to craft malicious llm commands with arbitrary Python code, potentially granting full control of the victim's system. Defenders should prioritize verifying the llm CLI tool version and applying patches or mitigations to prevent code injection attacks.

Defensive priority

Defenders should prioritize verifying the llm CLI tool version and applying patches or mitigations to prevent code injection attacks.

Recommended defensive actions

  • Verify the llm CLI tool version and ensure it is updated to a patched version.
  • Implement additional security controls to prevent code injection attacks.
  • Monitor systems for suspicious activity related to the llm CLI tool.
  • Educate users on the risks associated with the vulnerability and the importance of secure coding practices.
  • Review compensating controls for exposed systems while remediation is scheduled and verified.
  • Track exceptions, retest remediated assets, and close the item only after evidence is documented.
  • Confirm whether affected product deployments exist in managed environments and assign an owner for follow-up.

Evidence notes

The vulnerability exists in llm CLI tool versions through 0.27.1. The --functions argument is vulnerable to code injection due to the use of the exec() function without proper sanitization. This allows attackers to execute arbitrary Python code, potentially granting full control of the victim's system. Defenders should verify the llm CLI tool version and apply patches or mitigations to prevent code injection attacks. Evidence is based on the source advisory and CVE record.

Sources and references

Verified primary and authoritative sources

  • CVE-2026-31236 CVE Program record

    Publisher, destination, and source semantics verified

    URL: https://www.cve.org/CVERecord?id=CVE-2026-31236

    CVE Program - Official CVE Program record with source-provided CVE metadata.

  • CVE-2026-31236 NVD vulnerability detail

    Publisher, destination, and source semantics verified

    URL: https://nvd.nist.gov/vuln/detail/CVE-2026-31236

    NIST National Vulnerability Database - Official NIST NVD detail page and source-specific vulnerability assessment.

Supplemental references

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

    Unverified legacy reference

    URL: https://github.com/advisories/GHSA-g76p-4vg5-f4qh

    github_advisory_database

  • Source reference

    Unverified legacy reference

    URL: https://www.notion.so/CVE-2026-31236-35d1e139318881a4a0f1fffcf671f7e3

    Supplemental source

  • Source reference

    Unverified legacy reference

    URL: https://access.redhat.com/security/cve/CVE-2026-31236

    Supplemental source

  • Source reference

    Unverified legacy reference

    URL: https://github.com/pypa/advisory-database/tree/main/vulns/llm/PYSEC-2026-400.yaml

    Supplemental source

  • Source reference

    Unverified legacy reference

    URL: https://pypi.org/project/llm

    Supplemental source

  • Source reference

    Unverified legacy reference

    URL: https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-31236.json

    Supplemental source

Methodology and review provenance

AI-assisted synthesis based on stored public vulnerability evidence. System validation, approval state, and publication status do not by themselves establish human review of this revision. PatchSiren helps prioritize defensive review and does not prove exposure or remediation on any system.