Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessRegister or compromise HuggingFace account
-
DeliveryPublish repository with Python-injecting GGUF filename
-
ExploitLure victim to run whichllm run or snippet against repository
-
Executionwhichllm queries Hub API siblings rfilename field
-
PersistUnescaped filename breaks generated script string literal
-
ImpactInjected Python executes on victim machine before download
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | The attacker must control a HuggingFace repository and craft one or more GGUF filenames containing Python string metacharacters - such as double quotes, backslashes, or semicolons - that break out of the generated script's string literal context. The victim must be running whichllm in a version prior to 0.5.16 and must actively invoke the run or snippet subcommand targeting the attacker's repository (e.g., whichllm run attacker/model-name). No special server-side configuration or victim-side authentication beyond normal tool operation is required. Exploitation is limited by the need for active user interaction: the victim must choose to query the attacker's specific repository, meaning the attacker must plausibly surface their repository to the target population - typically via social engineering in model-sharing communities, leaderboard manipulation, or typosquatting of popular model names. The vulnerability does not affect users who invoke whichllm only against repositories they themselves own and control. |
| Impact | The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:A) scores 8.6, reflecting high real-world impact constrained by a single prerequisite: the victim must actively invoke whichllm run or whichllm snippet against the attacker's repository. On the attacker side, complexity is genuinely low - a free HuggingFace account and basic knowledge of Python string syntax are sufficient to craft the payload. EPSS data is absent from the provided intelligence, so exploitation probability cannot be quantified numerically; however, the vulnerability class - unsanitized string interpolation into dynamically executed code - is thoroughly understood and the open-source codebase makes technique reproduction straightforward. The primary attack friction is social engineering: the attacker must surface a malicious repository to practitioners who routinely explore third-party models via community forums, Discord servers, and leaderboard sites, making this a realistic delivery vector for the tool's target population. No active exploitation is confirmed in CISA KEV and no public POC is referenced in the available intelligence - these signals moderate immediate urgency relative to the theoretical severity. The vendor-confirmed patch in v0.5.16 directly addresses the root cause with proper escaping, making remediation low-cost and unambiguous. |
| Exploit ScenarioDerived | An attacker registers a HuggingFace account and publishes a model repository in which a GGUF file is named with embedded Python - for example, a filename containing a closing double-quote followed by arbitrary statements such as os.system calls or reverse shell payloads. When a developer discovers this model via a forum recommendation and runs whichllm run attacker/malicious-model, whichllm queries the Hub API, retrieves the crafted rfilename value, interpolates it unescaped into a generated Python script, and executes that script - running the attacker's payload on the developer's workstation before any download dialog or integrity check occurs. No public proof-of-concept is referenced in the available intelligence, though the technique is straightforward to reproduce given the publicly available source code. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 26, 2026
Code injection in whichllm's run and snippet CLI commands allows a network-positioned attacker who controls a HuggingFace repository to achieve full arbitrary code execution on any victim's machine by publishing a repository containing a crafted GGUF filename with Python metacharacters. The script generation function in cli.py interpolates the HuggingFace Hub API siblings rfilename field directly into dynamically generated Python source without escaping, enabling a string-literal breakout that fires injected code before any model download occurs. No active exploitation is confirmed in CISA KEV and no public proof-of-concept is referenced; vendor-released patch v0.5.16 is available and directly remediates the root cause.
RemediationAI
Upgrade whichllm to v0.5.16 or later, which escapes HuggingFace model IDs, GGUF filenames, and quantization types before interpolating them into generated run and snippet scripts, as explicitly noted in the release changelog and introduced via PR #147 (commit 77e8dc9e8b45212c694d631d758623e17a00859e). The release is available at https://github.com/Andyyyy64/whichllm/releases/tag/v0.5.16. For environments where immediate upgrade is not possible, the most effective compensating control is to restrict use of the run and snippet commands exclusively to HuggingFace repositories fully controlled by your organization, avoiding any third-party or community-sourced models until the patch is applied. If whichllm is used in automated pipelines or CI/CD workflows, enforce an allowlist of permitted repository identifiers at the pipeline configuration level. VulnCheck advisory: https://www.vulncheck.com/advisories/whichllm-code-injection-via-run-and-snippet-commands.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
whichllm (CPE: cpe:2.3:a:andyyyy64:whichllm:*:*:*:*:*:*:*:*) is a Python CLI tool that interfaces with the HuggingFace Hub to discover, compare, and run GGUF-format large language models. The run and snippet commands generate Python scripts dynamically by string interpolation, embedding metadata fetched from the HuggingFace Hub API - including file listings from the repository siblings array, specifically the rfilename field. The root cause is CWE-94 (Improper Control of Generation of Code): the script generation function in cli.py treats attacker-controlled API responses as trusted literals rather than untrusted data, allowing Python metacharacters such as double quotes to escape the generated string context and inject arbitrary Python expressions into the script body. Because HuggingFace repository filenames are set freely by any account holder, the attack surface is fully externally reachable. Injected code executes in the Python interpreter's context before any model file is downloaded, giving the victim no opportunity to inspect incoming content.
Know when Whichllm gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
Network vector because the attacker controls a remote HuggingFace repository; PR:N since no victim-system privileges are needed; UI:R because the victim must actively invoke the whichllm command; full CIA impact given arbitrary code execution in the user's context.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
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.
Executive ViewAI
whichllm CLI tool versions prior to v0.5.16 allow remote code execution when developers use the run or snippet commands with HuggingFace repositories. While no public exploit has been identified at the time of analysis, an attacker controlling a repository could achieve full system compromise on any developer's machine, affecting organizations that rely on whichllm for model management.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
EUVD-2026-66642
GHSA-hfpc-7mr4-p297
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB