Hugging Face Load/Mine Campaign - trust_remote_code Models That Mine Crypto on GPU Hosts
Load/Mine is a malware campaign that used Hugging Face as its delivery network. Pluto Security published its analysis on October 29, 2026: dozens of repositories dressed up as small Qwen2 test models that, when loaded with trust_remote_code enabled, installed a disguised cryptominer and, in some builds, an SSH backdoor. The targets were the machines most worth stealing compute from - GPU hosts running self-hosted inference servers. This advisory covers how the campaign works, why platform scanning missed it, what to check, and where it touches the AI tooling on your own fleet.
What happened
Pluto counts 31 malicious repositories across seven Hugging Face accounts, plus a mirror on Alibaba's ModelScope hub. Together they recorded 29,818 downloads, or 32,376 counting 13 linked repositories. Pluto stresses that these are download counts, not confirmed infections: automated pipelines and mirrors download models too. The flagship, MENXIANGYU/qwen2-tiny, accounted for about 28,400 of those downloads and contained no real model at all. Hugging Face has since disabled access to it.
Pluto reported the first wave to Hugging Face and ModelScope, and both removed the accounts. Within days, a second wave of 19 repositories appeared under new accounts, and Pluto says it stayed live for at least eight days after being reported. BleepingComputer found a near-identical copy uploaded on October 25 by a newer account still live when it wrote its story. Pluto attributes the campaign to a financially motivated, Chinese-speaking operator; reporting puts the operator's take at roughly 2,276 PRL, about $5,000.
| Claim | Status |
|---|---|
| 31 repositories across seven Hugging Face accounts, plus a ModelScope mirror | Pluto's count |
| 29,818 downloads (32,376 with linked repos) | Pluto's count; downloads, not infections |
| Nine machines on an apparently shared research GPU cluster mined for the operator | Observed by Pluto |
| First-wave accounts removed by Hugging Face and ModelScope | Reported by Pluto |
| A second wave of 19 repositories appeared under new accounts | Reported by Pluto and BleepingComputer |
| Operator earned about $5,000 in Pearl (PRL) | Reported; based on wallet receipts |
| How many hosts are still infected | Unknown |
How trust_remote_code turns a download into code execution
Hugging Face Transformers lets a model repository ship its own Python classes for architectures the library does not know. The repository's config.json carries an auto_map entry that names those classes, and when a caller passes trust_remote_code=True, Transformers downloads the referenced .py files and imports them. Importing a Python module runs it. So the attacker's code executes during the load call, before any weights are read - which is why a repository with no real model in it works perfectly well as a dropper.
None of this is a vulnerability. It is the documented behaviour of the flag, and the flag exists because many legitimate new architectures need it. Inference servers that load arbitrary models by name, such as Xinference and GPUStack, often enable it so a user can serve whatever they point at. That is what made them the target: an operator trying a "tiny Qwen2 for testing" on a GPU host hands the repository the same privileges as the server process. It is also the same flag behind a run of serving-engine bugs, including the vLLM trust_remote_code bypass, where the server set it to true without being asked.
What the payload does
Pluto traced the campaign from a single file, a 305-line modeling_evil.py under a random-string account name that matched for subprocess, socket, ctypes and memfd_create. Later builds were quieter, using ordinary names such as Qwen2Config and modeling_qwen2.py. Across the waves, Pluto describes:
- A miner Pluto identifies as peakminer, mining Pearl (PRL) against attacker pools, which suits GPU hosts.
- A fileless launch through
memfd_create, so the miner binary never sits on disk under its own name, with the process renamed to look like a kernel worker thread,[kworker/u20:1]. - In wave one, an install under
/root/.xinference/cache, a directory an Xinference operator expects to be full of large files. - A backdoor variant Pluto calls qwen2-shell, which writes an Ed25519 key into
authorized_keysand beacons to a server on Alibaba Cloud, and in some builds a reverse shell. - Iteration between waves: Pluto describes the operator revising the loader as detections landed, and says the second-wave flagship scanned clean.
The SSH key is the part that outlasts the miner. A host that stops mining because the repo was deleted, or because the loader crashed, can still carry the attacker's key.
Why platform scanning missed it
Hugging Face scans uploads with antivirus engines and with partner scanners from Protect AI and JFrog. Those checks look for known malware signatures and unsafe serialization formats such as pickle. They do not judge what a repository's own Python does when imported, and they cannot: a modeling file that opens a socket or calls subprocess is unusual, but not proof of malice. A loader written to avoid known signatures passes, and the platform's "safe" label describes the weights format, not the code that runs before them. Removing accounts works, but the second wave shows the cost to the operator of a takedown is a new account name.
What to do
- Find who loads remote code. List the inference servers you run (Xinference, GPUStack, vLLM, Text Generation Inference and similar), whether each allows
trust_remote_code, and which models it has pulled. Search fortrust_remote_code=Truein notebooks, scripts and pipelines. - Check for the campaign's models. Look in Hugging Face and ModelScope caches for small Qwen2-style repositories from unfamiliar accounts, starting with
MENXIANGYU/qwen2-tiny, and for amodeling_evil.pyanywhere in a model cache. - Check hosts that loaded one, even if the load failed. Look for unexpected entries in
authorized_keys, processes named like[kworker/u20:1]that are not real kernel threads (a kernel thread has no executable path), anonymousmemfd:executables, unexpected files under/root/.xinference/cache, and outbound connections to mining pools. Pluto warns that normal-looking GPU use does not clear a host. - Rebuild and rotate. Rebuild a compromised host rather than cleaning it. Rotate every credential it could reach: Hugging Face tokens, cloud credentials, SSH keys and the provider API keys an inference box often holds.
- Change the default. Leave
trust_remote_codeoff, and before turning it on for a repository, read every.pyfile itsauto_mapnames. Pin a reviewed revision (a commit hash, not a branch) so the code cannot change under you. - Constrain the server. Run inference servers as an unprivileged user in a container with restricted egress, so a loader that does run cannot reach a mining pool or open a tunnel.
Why this is an agentic-endpoint risk
The direct targets were GPU servers, but the habit Load/Mine exploits starts on laptops. A developer who wants to try a model runs a one-line load in a notebook, or asks a coding agent to "spin up a small Qwen model to test against" and lets it run the command. The agent copies whatever example it finds, and the examples for unfamiliar architectures say trust_remote_code=True. The same laptop holds Hugging Face tokens, cloud credentials and AI provider keys - the material that turns a free GPU into stolen inference spend once it leaks. Load/Mine is one more campaign in the pattern the AI supply-chain defender's guide tracks: trusted registry, attacker code, run at load time.
How Anomity helps
Anomity's Endpoint Sensor covers the managed-laptop half of this. It inventories local LLM runtimes on each endpoint, alongside the AI agents, MCP servers, extensions, skills, hooks and CLIs, so you know which developers run models locally and with what. It also finds Hugging Face tokens among the secrets on each machine, with values redacted on the endpoint, which gives you the rotation list for any machine that may have loaded a campaign model.
On agents that expose a hook, such as Claude Code PreToolUse, Anomity returns allow, deny or log on each tool call before it runs. A policy can log or deny an agent's shell commands that load a model with trust_remote_code=True, or that pull from an unreviewed hub account, so an agent cannot quietly make that choice for a developer. Every decision lands in the 90-day audit trail and routes to your SIEM, Slack, email or Jira.
The limits matter here. Anomity does not scan model repositories, and it covers the machines its sensors are installed on, not shared GPU servers it does not run on. Xinference and GPUStack are not in its runtime inventory today. Container hardening, egress control and EDR on the GPU hosts remain the controls for the servers themselves; Anomity complements them by covering the developer endpoints and agents that choose which models to load.
You can't govern what you can't see.The Anomity principle
What to check across your fleet
- Every inference server: does it allow
trust_remote_code, and which repositories has it pulled in recent weeks? - Model caches on servers and laptops: any
MENXIANGYU/qwen2-tiny, anymodeling_evil.py, any tiny Qwen2 test models from accounts nobody recognises. - Hosts that loaded one:
authorized_keys, fake[kworker]processes,memfd:executables,/root/.xinference/cache, outbound mining traffic. - Which developer machines hold Hugging Face tokens, and which run local LLM runtimes.
- Whether coding agents may run model-loading commands unreviewed, and whether those commands are logged at the hook.
- For the serving-engine side, the LightLLM pickle deserialization RCE, the other common way a model server runs attacker code.
Load/Mine needed no exploit: it used a documented flag, a free hosting platform and the habit of loading a small test model without reading its code. Check the hosts that pulled campaign repositories, rotate what they could reach, and make trust_remote_code a reviewed decision rather than a default. To see which of your developers run local models and hold hub tokens, book a 30-minute demo.
Frequently asked questions
What is the Hugging Face Load/Mine malware campaign?
Load/Mine is a campaign Pluto Security disclosed on October 29, 2026, in which 31 model repositories across seven Hugging Face accounts, plus a ModelScope mirror, posed as small Qwen2 test models. When loaded with trust_remote_code enabled, they ran bundled Python that installed a disguised cryptominer mining Pearl (PRL) and, in some builds, an SSH backdoor or reverse shell. The targets were GPU hosts running self-hosted inference servers such as Xinference and GPUStack.
Is loading a Hugging Face model with trust_remote_code dangerous?
It runs the repository's own Python code on your machine with the privileges of the loading process, before any weights are read. That is the documented purpose of the flag, so it is only as safe as the code in the repository. Leave it off by default, read every Python file the repository's auto_map points to before enabling it, and pin a reviewed commit so the code cannot change after you read it.
Why didn't Hugging Face's malware scanning catch these models?
Hugging Face's antivirus and partner scanners from Protect AI and JFrog look for known malware signatures and unsafe file formats such as pickle. They do not judge what a repository's custom Python does when it is imported. The campaign's loaders avoided known signatures, and Pluto says the second-wave flagship scanned clean.
How do I check whether a machine was infected?
Check model caches for the campaign's repositories, starting with MENXIANGYU/qwen2-tiny, and for any modeling_evil.py. On a host that loaded one, look for unexpected keys in authorized_keys, processes named like [kworker/u20:1] that are not real kernel threads, anonymous memfd executables, files under /root/.xinference/cache, and outbound mining traffic. Pluto advises treating a host as compromised even if the load failed or GPU use looks normal, and rotating every credential it could reach.
How does Anomity help with this?
Anomity's Endpoint Sensor inventories local LLM runtimes and AI agents on managed endpoints and finds Hugging Face tokens among each machine's secrets, with values redacted on the endpoint, so you know who runs models locally and what to rotate. On agents with a hook, such as Claude Code PreToolUse, it can log or deny model-loading commands that enable trust_remote_code. It does not scan model repositories or cover GPU servers without a sensor, so it complements container hardening, egress control and EDR on those hosts.




