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

- Severity: Critical 9.8 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.33%, higher than 27% of CVEs (2026-12-01)
- Published: 2026-05-12T00:00:00.000Z
- Modified: 2026-11-16T15:15:04.188Z
- Also known as: GHSA-g76p-4vg5-f4qh, PYSEC-2026-400
- Weaknesses: CWE-94
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total
- 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.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- rhoai/odh-model-controller-rhel9: no versions given
- llm (PyPI): up to 0.27.1

## Every score

- CISA-ADP: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- redhat-SADP: CVSS:3.1 7.3 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- PyPA Advisory Database: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://github.com/simonw/llm> (package)
- <https://www.notion.so/CVE-2026-31236-35d1e139318881a4a0f1fffcf671f7e3> (web)
- <https://access.redhat.com/security/cve/CVE-2026-31236> (vdb-entry, web)
- <https://bugzilla.redhat.com/show_bug.cgi?id=2476636> (issue-tracking, web)
- <https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-31236.json> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-31236> (advisory)
- <https://github.com/pypa/advisory-database/tree/main/vulns/llm/PYSEC-2026-400.yaml> (web)
- <https://pypi.org/project/llm> (package, web)
- <https://github.com/advisories/GHSA-g76p-4vg5-f4qh> (advisory)

## Sources

- CVE List: [CVE-2026-31236](https://www.cve.org/CVERecord?id=CVE-2026-31236), CVE Terms of Use, modified 2026-07-15
- GitHub Advisory Database: [GHSA-g76p-4vg5-f4qh](https://github.com/advisories/GHSA-g76p-4vg5-f4qh), CC-BY-4.0, modified 2026-11-16
- NVD: [CVE-2026-31236](https://nvd.nist.gov/vuln/detail/CVE-2026-31236), Public domain, modified 2026-07-15
- PyPA Advisory Database: [PYSEC-2026-400](https://osv.dev/vulnerability/PYSEC-2026-400), CC-BY-4.0, modified 2026-07-01

---

Page: https://cve.day/CVE-2026-31236 · Whole record: https://cve.day/CVE-2026-31236.json · Rebuilt by cve.day 2026-11-25T22:59:21.388Z
