A fake Hugging Face model that is only a few kilobytes of files can still run code on your server the moment you load its config. JFrog Security Research reports that on 24 November what it assesses was an AI agent called ARTEX published 13 repositories on the Hub built to steal secrets from whoever loaded them: two fake models, nine tokenizer test repos and two repos meant to collect the loot. Hugging Face disabled all 13 the same day, and JFrog found no victims, but the techniques work against any pipeline that pulls unreviewed repos.
Three ways into one machine
The first model, posing as a tuned 1B Llama, had three triggers. Its config.json used auto_map to point to attacker Python files, which run at import time when someone loads it with trust_remote_code=True. The same payload sat in the pickle weight files. A third path ran through a poisoned chat template, an injection in the Jinja template that renders prompts. Once triggered, the code read the environment of process 1 (/proc/1/environ, usually richer than the current process), the Kubernetes service account token and some host details.
The exfiltration channel is the clever bit. The payload committed the stolen JSON as a file to a Hugging Face repo, using a write token hardcoded in the code. There was no command server to block, because the only destination was huggingface.co, which ML workloads must reach anyway.
The agent robbed itself
The first loot file appeared 14 seconds after upload, and it was not a victim’s. It came from the operator’s own container, where JFrog found ARTEX runtime variables including an OpenAI key. JFrog assesses with high confidence that an ARTEX agent task built and tested the models, but says it cannot tell how much a human directed. Five hours later a second model arrived with no weights at all, only a config, a borrowed test tokenizer and two Python files. It slips past pickle scanners by design, and the Hub raised no warning on it. This is the same tool we followed in our ARTEX timeline for defenders and the Wiz operator log case.
Which fix closes which door
| Entry point | What closes it |
|---|---|
| Remote code via auto_map | Do not set trust_remote_code=True on repos you have not read; pin revision to a commit SHA |
| Pickle weights | torch 2.6 or newer with the default weights_only=True; prefer safetensors |
| Chat template injection | Render templates in a sandbox |
| Hub commit exfiltration | Read-only tokens for anything that only downloads |
Our own point: torch 2.6 helps with only one of four rows, and the weightless second model never touched pickle. Teams that upgraded torch and considered themselves covered are still exposed through the first row. JFrog’s own line says it best: “A workload that loads models should be able to download from the Hub, not commit to it.”
A checklist for this afternoon
- Code: run
grep -rn "trust_remote_code" .in every repo and notebook. Each hit is a place where a stranger’s Python can run, so list the repos it loads. - Torch: check
python -c "import torch; print(torch.__version__)"on training and serving images. Anything below 2.6 loads pickles with fewer safeguards. - Pins: every
from_pretrainedcall on a third party repo should carryrevision=with a full commit SHA, not a branch name. JFrog notes that an earlier revision of the second model stayed armed even after the latest one was broken. - Tokens: replace write tokens on inference and CI hosts with fine-grained read-only tokens, and revoke any token that was ever in an environment variable on a shared host.
- Cache: look for downloaded remote code in
~/.cache/huggingface/modulesand review what is there. - Network: alert on outbound POSTs to
huggingface.co/api/models/*/commit/mainfrom hosts that should only download. JFrog also published YARA rules and indicators.
What is still open
JFrog says the campaign looks like probing of a particular model hosting or evaluation platform, not a mass lure, and that the loot repos were empty when they were disabled. Who directs the agent is unknown. For earlier Hub incidents see our report on the Kokoro-82M account takeover and our supply chain incidents.



