Brief · Both
An ARTEX agent built a credential-stealing Hugging Face model, tested it on itself, and published its own OpenAI key
On Nov 24, JFrog Security Research published what happened when an attacker's AI agent tried to ship a trojanized model on Hugging Face and caught itself in the test. JFrog sells Artifactory Curation, a registry proxy built to block risky models and packages before developers download them, and its post ends with a pitch for that product. Even with the sales pitch, the forensic trail is worth reading, because the agent leaked its own container environment and task list straight into its public drop repo.
What the agent built, and how it robbed itself
At 02:43 UTC on Nov 24 (Nov 23, 9:43 PM ET), a new Hugging Face account (hfusr5488184) appeared, and 22 minutes later it created a repository named llama-3.2-1b-tuned. The model card promised a fine-tuned 1B instruct model, while the .bin weight files were about 2.5 KB instead of more than two gigabytes.
JFrog found a credential stealer with three ways to run code: config.json auto_map pointers to attacker Python modules (which execute when loaded with trust_remote_code=True), malicious pickle payloads inside both .bin files, and a chat template carrying Jinja server-side template injection (SSTI). Instead of phoning home to a separate server, the payload reads the host environment, /proc/1/environ, and Kubernetes service-account files, then commits the JSON dump straight back to a public Hugging Face repo using an embedded Hub write token. Because ML jobs are usually allowed to reach huggingface.co, that slips past basic egress allowlists—with one flaw for the operator: public repository means public loot.
Fourteen seconds after the files went up, the payload fired and committed a 16 KB environment dump into the repo, followed three seconds later by a test marker from /app/data/tasks/61/ihfprep2, a second run 35 seconds later, and a NOEXFIL self-test switch. The agent had tested its own decoy on its own container and published its own secrets.
What leaked, and how the agent adapted
The container's leaked ARTEX_* variables showed ./artex running gpt-5.4 through a third-party API reseller, a Postgres state database, and an OPENAI_API_KEY. Its process list showed several tasks running in parallel: a phishing server behind a cloudflared tunnel, an SSRF callback server, and more than ten proxy relays pinned to residential IPs across five countries.
Thirty minutes after the first model, the account uploaded nine small repositories (toktest1 through toktest9) and an empty lootrepo to test how a target handles malformed tokenizer JSON, size limits, and trust_remote_code flags. JFrog reads that as probing a specific platform that ingests user-supplied Hugging Face repos rather than luring individual developers. Almost five hours later, the renamed account (akashdutta1030) uploaded mistral-7b-utterance and a separate loot drop repo. This second model carried no weight files at all—just a Mistral config, Python modules, a borrowed Hugging Face test tokenizer, and an SSTI chat template—so Hugging Face's pickle scanner showed zero warnings. Its collector hunted /scratch/models, /workspace, the Hugging Face cache, and NATS, Postgres, and Redis variables. A final broken config.json commit disabled the latest revision under standard transformers, while an earlier commit stayed armed.
JFrog assesses with high confidence that an ARTEX agent built, uploaded, and tested the models, though the data can't show how much the model chose on its own versus what a human operator directed. I've covered ARTEX before in the Amazon MadPot and FBI brief and the Vapor Panda Calm down.
The scope here stayed tiny. JFrog searched its public Hugging Face index and found none of the payload hashes or loot files anywhere else, both drop repos (lootrepo and loot) were still empty when Hugging Face disabled all 13 repositories on Nov 24 (confirmed by 13:29 UTC, or 8:29 AM ET), and no victim data had come back.
What to do
-
Keep
trust_remote_codeoff on models you haven't reviewed, and pin a commit.- Why:
auto_mapruns attacker Python as soon as the config loads, even when a repository carries no weights, and a broken main-branch commit leaves earlier revisions armed. - How: Load Hugging Face repos without
trust_remote_code=Trueunless you've inspected the Python files at that exact commit, and pass a full commit SHA torevision=(item 22 of the Builder's Checklist; see also item 12).
- Why:
-
Run PyTorch 2.6 or newer, and render chat templates in a sandbox.
- Why: The first decoy also packed malicious pickles and a Jinja SSTI chat template that tries to run shell commands when rendered.
- How: Use PyTorch 2.6 or later with the default
weights_only=True, avoidweights_only=Falseor rawpickle.loadon untrusted files, and make sure inference servers render chat templates in a sandboxed Jinja environment liketransformers'ImmutableSandboxedEnvironment.
-
Give model-loading jobs read-only Hub access and tight container boundaries.
- Why: The payload used
huggingface.coitself as its drop box because ML workloads normally allow outbound Hub traffic. - How: Give evaluation and serving workloads read-only Hub tokens—or no Hub token at all for public models (item 2)—run them as a non-root user with minimal secrets in the environment (item 4), and restrict outbound writes or unnecessary egress (item 9).
- Why: The payload used
-
If you ingest user-supplied model repos, scan beyond weight files.
- Why: The second decoy had no weights and drew no Hugging Face scanner warning, and the tokenizer probes checked how an automated pipeline handles broken configs and fallback paths.
- How: Vet external model repos like third-party software (item 7 of the Business Checklist), flag
auto_mapor Python modules even when weights are missing, fail closed on invalidconfig.json, and sandbox any automated ingestion pipeline as untrusted execution (item 10).
Want the next one?
One email, weekly-ish. The week's briefs, how worried to be, and what to do about it. No doom.
Subscribe on Beehiiv ↗Free. Opens Beehiiv in a new tab. Unsubscribe whenever, I won't be offended.