CVE-2026-58474

whichllm < 0.5.16 Code Injection via run and snippet commands

Published Aug 26, 2026 CVSS 4.0 · 8.6 High EPSS < 1% KEV · Not listed
Description
whichllm before 0.5.16 contains a code injection vulnerability in the run and snippet commands that allows a remote attacker who controls a HuggingFace repository to achieve arbitrary code execution by crafting a malicious GGUF filename containing double quotes or other special characters. The script generation function in cli.py interpolates HuggingFace-derived values, including GGUF variant filenames from the Hub API siblings rfilename field, directly into Python source code without escaping, allowing the crafted filename to break out of the generated string literal and execute injected code on the user's machine before any model download occurs.

Analysis

AI-generated

Technical impact

the vulnerability in whichllm before version 0.5.16 allows a malicious GGUF filename containing double quotes or other special characters to break out of a generated string literal and execute arbitrary code on the victim’s machine. the injection occurs during the script generation step in cli.py, where HuggingFace‑derived values are interpolated directly into Python source without escaping, leading to remote code execution before any model download occurs. the weakness is classified as CWE‑94: Improper Syntax Checking for Code Injection

Affected Systems

the affected product is whichllm from vendor Andyyyy64, affecting all installations with a version earlier than 0.5.16

Risk and Exploitability

the CVSS score of 8.6 indicates high severity, and the lack of an EPSS score means the exploit probability is not quantified. because the vulnerability requires a remote attacker to control a HuggingFace repository, the attack vector is indirect but feasible for malicious repository authors. the vulnerability is not listed in CISA KEV, yet it can be exploited by any user executing run or snippet commands with a crafted repository.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade whichllm to version 0.5.16 or later.
  • Restrict access to the HuggingFace hub so that only trusted repositories are used, or sign uploads to verify integrity.
  • If upgrading is not immediately possible, avoid running run or snippet commands against untrusted repositories until temporary mitigations are applied.

Generated by OpenCVE AI on August 26, 2026 at 19:44 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Andyyyy64
Andyyyy64 whichllm
Vendors & Products Andyyyy64
Andyyyy64 whichllm
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description whichllm before 0.5.16 contains a code injection vulnerability in the run and snippet commands that allows a remote attacker who controls a HuggingFace repository to achieve arbitrary code execution by crafting a malicious GGUF filename containing double quotes or other special characters. The script generation function in cli.py interpolates HuggingFace-derived values, including GGUF variant filenames from the Hub API siblings rfilename field, directly into Python source code without escaping, allowing the crafted filename to break out of the generated string literal and execute injected code on the user's machine before any model download occurs.
Title whichllm < 0.5.16 Code Injection via run and snippet commands
Weaknesses CWE-94
References
Metrics cvssV3_1

{'score': 8.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 8.6, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-94

    Improper Control of Generation of Code ('Code Injection')

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Aug 29, 2026, 11:47 AM
Reserved
Jun 30, 2026, 8:20 PM
Status
Deferred
Published
Aug 26, 2026, 6:16 PM
Modified
Sep 24, 2026, 8:43 PM