GHSA-g76p-4vg5-f4qh

Suggest an improvement
Source
https://github.com/advisories/GHSA-g76p-4vg5-f4qh
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-g76p-4vg5-f4qh/GHSA-g76p-4vg5-f4qh.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-g76p-4vg5-f4qh
Aliases
Published
2026-05-12T18:30:41Z
Modified
2026-06-29T12:26:52Z
Severity
  • 9.8 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
llm CLI tool contains a code injection vulnerability via `--functions` command-line argument
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.

Database specific
{
    "cwe_ids":  [
        "CWE-94"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-05-27T22:22:41Z",
    "nvd_published_at":  "2026-05-12T18:16:51Z",
    "severity":  "CRITICAL"
}
References

Affected packages

PyPI / llm

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Last Affected
0.27.1

Affected versions

0.*
0.1
0.2
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.9a0
0.9a1
0.9
0.10a0
0.10a1
0.10
0.11
0.11.1
0.11.2
0.12
0.13
0.13.1
0.14
0.15
0.16
0.17a0
0.17
0.17.1
0.18a0
0.18a1
0.18
0.19a0
0.19a1
0.19a2
0.19
0.19.1
0.20
0.21
0.22
0.23a0
0.23
0.24a0
0.24a1
0.24
0.24.1
0.24.2
0.25a0
0.25
0.26a0
0.26a1
0.26
0.27
0.27.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-g76p-4vg5-f4qh/GHSA-g76p-4vg5-f4qh.json"