CVE-2026-58474: whichllm < 0.5.16 Code Injection via run and snippet commands

Published Aug 26, 2026
·
Updated

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.

Affected Software

1 affected component
whichllm<0.5.16

Event History

Aug 26, 2026
CVE Published
via MITRE·05:49 PM
Data Sourced
via MITRE·05:49 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:16 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which installations are affected?

whichllm versions before 0.5.16 are affected when the run or snippet commands process HuggingFace repository metadata.

2

What does an attacker need to exploit this issue?

An attacker needs control of a HuggingFace repository and must provide a malicious GGUF filename through the repository's Hub API metadata. The filename can contain double quotes or other special characters that escape the generated Python string literal.

3

Does exploitation require a model to be downloaded?

No. The injected code can execute on the user's machine during script generation, before any model download occurs.

4

What can be done if an immediate upgrade is not possible?

Avoid using the run and snippet commands with HuggingFace repositories that are not trusted. Upgrade to version 0.5.16 or later when possible.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203