CVE-2026-58474 whichllm < 0.5.16 Code Injection via run and snippet commands
A remote attacker can achieve arbitrary code execution on a user's machine by crafting a malicious HuggingFace repository filename that exploits unescaped string interpolation in the whichllm CLI.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- None listed
What is CVE-2026-58474?
CVE-2026-58474 is a high-severity code injection vulnerability in Andyyyy64 whichllm, published on 26 Aug 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official 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.
Weakness: CWE-94
Which versions are affected by CVE-2026-58474?
How do I fix CVE-2026-58474?
No fix has been published for CVE-2026-58474 yet. Limit exposure of the affected software until one is available.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2026-58474 being exploited?
There is no known exploitation of CVE-2026-58474 in the wild and no public exploit code.
Sources
Also known as GHSA-hfpc-7mr4-p297.