Pluto Security details a trust_remote_code cryptomining campaign
Pluto Security’s analysis, reported by The Next Web, describes a cryptomining campaign on the Hugging Face Hub that executed Python code through the trust_remote_code=True model-loading path rather than an exploit. Malicious repositories presented themselves as small Qwen2 models and used imported Python modules to install persistence, open a reverse shell, download a disguised miner and report its status. Pluto Security found that repository scanners marked the plain Python payload as safe because it did not match a known malware signature or serialized-model format.
The campaign shows that enabling trust_remote_code can grant a model repository code execution and persistent access, while a clean antivirus scan does not establish that a model repository is safe.

The trick at the center of this campaign is not an exploit. It is a feature. Pluto Security’s analysis of a cryptominer operation on the Hugging Face Hub shows that the attacker never needed to break anything. The model-loading library runs the Python that infects a machine exactly as designed.
Three doors, one left open
Loading an open model can run code through three different doors. One is the parser that reads a binary format such as GGUF. That is the surface behind CVE-2024-34359, where a chat template stored in a GGUF file executed code through llama-cpp-python.
#Pluto Security#Hugging Face#Transformers#Qwen2#peakminer#Xinference#llama-cpp-python