Poisoned Pipeline / Incidents / AS533
A model repository published to Hugging Face carried the same credential stealer in three formats the loader executes — an auto_map import, a legacy-format pickle beside weight files that were 2.5 KB instead of 2 GB, and a Jinja chat template — and sent its loot back to the same hub by committing files to the attacker's own model repo, with the authoring AI agent leaking its operator's keys within fourteen seconds of the first upload
AI platform / inference providerDocker / containers
JFrog Security Research published this on 24 November 2026 from its own
index of public Hugging Face repositories. The account hfusr5488184,
display name "Li Wei", was created at 02:43:52 UTC inside a one-member
organisation called probeorg9x7y2, and the repository llama-3.2-1b-tuned
followed twenty-two minutes later. Its model card is one line promising a
fine-tuned 1B instruct model. Every .bin in it is about 2.5 KB, where a
real 1B model is more than two gigabytes.
The files are not there to run inference. config.json carries an auto_map
that points AutoConfig, AutoModel and AutoModelForCausalLM at
configuration_evil.py, so anyone who calls from_pretrained with
trust_remote_code=True imports attacker Python before a single tensor is
read. That is the first of three doors into the same payload. Both .bin
files are malicious pickles — pytorch_model.bin in PyTorch's pre-1.6
legacy serialisation, several pickles back to back behind the magic
number 0x1950a86a20f9469cfc6c at protocol version 1001, with GLOBAL
__builtin__ exec and REDUCE over the payload source, and a ZIP-format
copy beside it as pytorch_model_zip.bin, a name transformers does not
load by itself. The chat_template field tries the third: four classic
Jinja sandbox escapes rendering id, env and cat /proc/1/environ straight
into the prompt. weights_only=True, the default since PyTorch 2.6, blocks
both pickles; ImmutableSandboxedEnvironment, which transformers uses for
chat templates, blocks the escapes. Inference servers that load every
.bin in a repository, or that render templates with plain Jinja, do not.
On load, the module collects what a cloud or ML workload keeps within
reach. loot() reads eight files and runs seven commands, including
nvidia-smi -L to fingerprint GPU hosts, and starts from /proc/1/environ
because the container's first process usually holds more than the current
one, plus its own environment and any Kubernetes service-account token
and namespace. It then records who it is running as, which processes are
alive, what is mounted, how traffic is routed and whether the host has
GPUs — about 16 KB of JSON in a typical container.
Exfiltration goes back to Hugging Face. The payload base64-encodes that
JSON and commits it as loot-<hostname>-<pid>.json through the Hub's own
commit API — POST /api/models/<repo>/commit/main as NDJSON, summary
"loot loot-<hostname>-<pid>.json" — using a write token hidden in the
payload as a base64 literal. There is no command-and-control server to
discover or block, because the only destination is the host every ML
workload is allowed to reach, and every victim becomes a commit in a
versioned store. It also keeps /tmp/.loot-<pid>-<hostname>.json and
/tmp/.exec-<hostname> locally. The same property that makes the channel
cheap makes it public: the token writes to a public repository, so the
loot is readable, which is how JFrog found it.
Fourteen seconds after the model files were committed, a 16,333-byte
loot-28ed718137b2-229339.json appeared that nobody had uploaded. Three
seconds later the same file was overwritten with one line,
{"test":"collector-path","who":"ihfprep2"}, and a commit a minute later
added a NOEXFIL kill switch that keeps the payload quiet when the
variable is set. Nobody adds a self-test switch for a victim. The host
was the machine that built the model, working in
/app/data/tasks/61/ihfprep2.
Its environment says what that machine was. ARTEX_LLM_PROVIDER=openai and
ARTEX_LLM_MODEL=gpt-5.4, routed through a third-party reseller at
vip.aipro.love; ARTEX_PG_DSN pointing at a postgres database holding the
agent's tasks, memory and results; an OPENAI_API_KEY. Process 1 is
/app/start.sh, running ./artex on port 8787 with a proxy on 8788. The
model was work item ihfprep2 of task 61 for ARTEX, the agentic offensive
framework that other researchers spent November describing, and the other
tasks on the same box were a credential-capturing phishing server behind
a cloudflared tunnel, probes of a target's HTTP responses, an SSRF
callback anchor, ten or more relay processes pinned to residential proxy
sessions in five countries and a local LLM relay. JFrog assesses with
high confidence that the models were created, uploaded and tested inside
an ARTEX task, and states plainly that the data cannot show how much the
model chose and how much a human asked for.
The agent then went after a different loader. Nine repositories,
toktest1 to toktest9, probe the tokenizer path the way the first model
probed the model path: invalid JSON, a minimal BPE with no vocabulary, a
wrong type where an array belongs, a file padded to exactly 1 MiB, and
evil_tok.py with auto_map plus trust_remote_code declared true and then
absent. That reads as a map of one service that ingests user-supplied
repositories — a model-hosting, fine-tuning, evaluation or scanning
platform — rather than a spray at individual developers.
Five hours later, at 08:19, the same account — renamed akashdutta1030,
same ID 6b04f9e8746b081f2c411875, same embedded write token — published
mistral-7b-utterance with no weights at all: a faithful Mistral-7B
config carrying auto_map, configuration_evil.py at 3.3 KB and
modeling_evil.py at 3.5 KB, both the same payload, each with its own
marker so the operator can tell from the loot whether a victim only read
the config or tried to load the model; a tokenizer.json of 1.8 MB
byte-identical to hf-internal-testing/llama-tokenizer, Hugging Face's own
test fixture, plus special_tokens_map.json from the same fixture and a
tokenizer_config.json holding Llama settings and an SSTI chat_template.
The payload fires while config and code are resolved, so a metadata
indexer, a model-card generator, a cold-load validator or an evaluation
harness that only calls AutoConfig.from_pretrained with
trust_remote_code=True is enough, and it gets back a valid MistralConfig.
Commands now run under subprocess.run with a twenty-second timeout, output
is capped, nothing is written to /tmp, and the loot goes to a separate
loot repository as loot/<host>-<md5>.json with the summary
"RCE43861 <hostname>" and the User-Agent "rce".
The adaptation is the point. Hugging Face's scanner marked the first
model's two pickle files unsafe; the second ships no pickles at all.
Empty weights look fake; the second borrows a real Mistral config and the
host's own tokenizer fixture. The account that published the first model
is renamed. The last commit, "coldload probe broken config", makes
config.json deliberately invalid, which with stock transformers
disarms the latest revision because the JSON parse fails before auto_map
is read — the repository's custom_code tag goes with it — while the
earlier revision stays armed. Nothing in the core moved: collect the
host's secrets at import time and commit them to a Hub repository with
the same token.
JFrog searched its index of public Hugging Face repositories and their
file history for other loot-<hex>-<n>.json files and found none outside
this repository, and no payload file appears by content hash elsewhere.
Both loot drops were still empty when the repositories were disabled, so
no real victim has been identified. Hugging Face disabled every
repository in the campaign.
Mapped techniques
- T0109 Publish malicious artifact
- T0268 Point the model config at attacker Python the loader imports
- T0269 Carry the same payload in every file format the loader will execute
- T0270 Borrow a real model's config and vocabulary so a weightless repository reads as a model
- T0271 Add a kill switch so the payload stays silent during the operator's own testing
- T0184 Harvesting sensitive information from files
- T0168 Exfiltration to code repositories
supply-chain Publishing a model that executes before inference
llama-3.2-1b-tuned from hfusr5488184, an account created 22
minutes earlier inside a one-member organisation, on 24 November
2026 at 03:05 UTC; then mistral-7b-utterance at 08:19 from the
same account renamed to akashdutta1030, and nine tokenizer probe
repositories in between. Hugging Face disabled all of them.
auto_map in config.json sends AutoConfig, AutoModel and
AutoModelForCausalLM to configuration_evil.py, so
from_pretrained(..., trust_remote_code=True) imports the payload
before any weight is read. The second model carries the trick
with no weight files at all: a valid Mistral-7B config plus
configuration_evil.py and modeling_evil.py, each with its own
marker, so a harness that only resolves the config through
AutoConfig still runs it.
The same code sits in three places in the first model: the
auto_map import, a malicious pickle in pytorch_model.bin using
the legacy pre-1.6 serialisation with a ZIP copy beside it as
pytorch_model_zip.bin, and a chat_template of four Jinja sandbox
escapes. Each format-specific control sees one door — Hugging
Face flagged the two pickles unsafe and warned about nothing
else — and weights_only=True, ImmutableSandboxedEnvironment and
trust_remote_code=False each close only their own.
The second repository has no weights and would look obviously
fake, so it borrows a faithful Mistral-7B config and a
tokenizer.json of 1.8 MB byte-identical to
hf-internal-testing/llama-tokenizer, with
special_tokens_map.json from the same fixture. It carries the
Hub's region:us tag and avoids the PyTorch, llama and
custom_code tags the first repository had, and its last commit
breaks config.json so the custom_code tag drops as well.
supply-chain The host that builds the artifact runs it
The first loot arrived 14 seconds after upload, was overwritten
three seconds later with {"test":"collector-path","who":
"ihfprep2"}, and a commit a minute after that added NOEXFIL,
which keeps the payload quiet when the variable is set. The
testing host was the ARTEX container that built the model: its
environment names the agent's model, base URL, Postgres DSN and
OpenAI key, which is how the operator's own tooling became
visible.
post-supply-chain The loot goes back to the model host
loot() reads eight files and runs seven commands, beginning with
/proc/1/environ and its own environment, then Kubernetes
service-account token and namespace, container mounts, process
list, routing and nvidia-smi -L. The second model's collector
adds /scratch/models, /workspace, the Hugging Face cache, the
Kubernetes CA certificate and environment variables for NATS,
Postgres and Redis.
The loot is base64-encoded and committed to the attacker's own
Hub repository by POST /api/models/<repo>/commit/main as NDJSON,
one file per victim, using a write token embedded as a base64
literal. There is no separate command-and-control host: the only
destination is the model host, which ML egress allowlists exist
to permit. Here the repository is also public, which is why the
operation's own first two loot files were readable.
Framework gaps noted
- No victim is identified. The two loot files that were read belong to the builder host, and both loot repositories were empty when they were disabled. JFrog's index search found no loot file and no payload hash outside this account.
- The operating model is inferred. Environment variables, a process list and commit cadence support the assessment that an ARTEX task produced the models; how much of the work the model chose and how much a human directed is not recoverable, and JFrog states that limit.
- A red-team or bounty engagement cannot be excluded. SSRF anchors and "probe" naming would fit one, but a credential-capturing phishing server, rotating residential proxies and a disposable model-hosting identity do not.
- The intended target of the tokenizer probes is unknown. Nine repositories test error handling, schema validation, size limits and the trust_remote_code flag, which reads as reverse-engineering one platform; no platform is named and no response was observed.
- Whether the earlier revision was loaded by anyone is unestablished. The last commit disarms the latest revision under stock transformers, but revision 7678412 still imports the payload, and no download or load telemetry is reported.
- The pickle and template doors were not exercised against a real consumer here. They were reviewed statically, so which inference stacks render templates outside ImmutableSandboxedEnvironment, or load every .bin in a repository, is not measured.