Hugging Face: a fake-model campaign leaked its own operator
Fake models on Hugging Face used the Hub's own commit API to exfiltrate secrets, and committed their operator's credentials by mistake.
· JFrog · Research by David Cohen (JFrog Security Research)
JFrog found 13 Hugging Face repositories whose fake models stole secrets and committed them back to the Hub, needing no command-and-control server. The first loot file came from the operator's own machine and exposed an ARTEX agent's keys.
01What happened
JFrog security researcher David Cohen published the campaign on 24 November 2026, the same day the attacker created the account. Thirteen repositories across one account and a linked organisation held two fake models, nine tokenizer test repositories and two loot repositories. Hugging Face disabled all thirteen the same day for a content policy violation, confirming at 13:29 UTC after JFrog reported the campaign by email and through the repository report option.
02How it works
Each fake model carried three execution paths: remote Python loaded through auto_map when trust_remote_code is set, a malicious pickle inside pytorch_model.bin, and server-side template injection in the chat template. On load the payload harvested environment variables, /proc/1/environ, Kubernetes service-account tokens and system details including GPU information, then committed them as JSON to a Hugging Face repository using a hardcoded write token. Using the Hub's commit API as the exfiltration channel removed the need for any attacker infrastructure.
03Who is affected
Workloads that load Hub models with trust_remote_code enabled, or that run a torch older than 2.6 where pickle loading is not restricted, are the exposed case. JFrog notes that the first fake model shipped .bin files of roughly 2.5 KB where a real 1B model exceeds 2 GB, and that the second shipped no weight files at all. JFrog says both loot repositories were empty when Hugging Face disabled them.
04What to do
Avoid trust_remote_code on unreviewed repositories, pin revision to a commit SHA, run torch 2.6 or later with weights_only, and render chat templates only in a sandbox. Give model-loading workloads read-only Hub access rather than write access. JFrog publishes YARA rules and an indicator list, and suggests watching for writes to the Hub commit API, reads of /proc/1/environ and service-account tokens, auto_map modules in repositories with no weights, and chat templates containing __globals__, __mro__, __subclasses__ or .popen(.
Questions people ask
- Did the Hugging Face fake-model campaign steal real victim data?
- JFrog reports that both loot repositories were empty when Hugging Face disabled them, that it found no other loot JSON files in its index of public repositories, and no payload file matching these hashes outside the attacker's account. The only data JFrog recovered came from the operator's own build machine, committed 14 seconds after the first model was uploaded.
- How did JFrog work out that an ARTEX agent built the models?
- The first loot file held environment variables from the machine that built the model, naming an autonomous agent called ARTEX configured to call gpt-5.4 through a third-party API reseller, along with its OpenAI key, Postgres credentials and task data. JFrog assesses with high confidence that the models were created and tested inside an ARTEX task, and says the human operator remains unidentified.
- Does running torch 2.6 protect against these malicious models?
- Running torch 2.6 or later with weights_only blocks the pickle path inside pytorch_model.bin, but JFrog describes two execution paths it does not cover: remote Python fetched through auto_map when trust_remote_code is enabled, and server-side template injection in the chat template. JFrog recommends pinning a revision SHA and rendering chat templates only inside a sandbox.
Sources 3 links, all fetched
- 1research.jfrog.comJFrog Research
- 2research.jfrog.comIndicator List
- 3research.jfrog.comYARA Rules