Poisoned Pipeline / Techniques / T0268

T0268 · Execution · TA04 · observed in 1 incident(s)

Point the model config at attacker Python the loader imports

AI Posture Open Source Security

A model repository is code as well as weights, and the loader is told
which code by the artifact itself. auto_map in config.json names the
modules for AutoConfig, AutoModel and AutoModelForCausalLM, and
from_pretrained(..., trust_remote_code=True) imports them before a
single tensor is read. The model file never has to load, the weights
never have to be real, and inference never has to succeed.

llama-3.2-1b-tuned, published to Hugging Face on 24 November 2026,
pointed all three classes at configuration_evil.py. Its .bin files
were about 2.5 KB each against more than two gigabytes for a real 1B
model. The second repository, mistral-7b-utterance, carried no weight
files at all — a faithful Mistral-7B config, configuration_evil.py and
modeling_evil.py, both holding the same collector and each with its own
marker, so the operator could read from the loot whether a target had
only resolved the config through AutoConfig or had tried to load the
model. The modeling class was a shim that fails under the auto-class
flow with a TypeError, after both payload copies have already reported
back. A metadata indexer, a model-card generator, a cold-load validator
or an evaluation harness that only calls
AutoConfig.from_pretrained(..., trust_remote_code=True) is enough to
run it.

It also behaves as a flag probe. Nine further repositories tested the
tokenizer path with evil_tok.py and auto_map with
trust_remote_code declared true and then absent, alongside malformed
JSON, a BPE with no vocabulary, a wrong type where an array belongs and a
file padded to exactly 1 MiB — the shape of a survey of how one service
ingests user-supplied repositories.

Distinct from T0244, where a site-packages hook runs at every interpreter
start, and from T0198, where a build-time dependency is malicious. Here
no package is installed at all: the artifact's own metadata names the
code, and the flag that permits it is a documented, user-set option that
many model-serving tools pass for legitimate models.

Where this idea came from

Public incident / advisory

From the Hugging Face models published on 24 November 2026, whose config.json auto_map named configuration_evil.py and modeling_evil.py so trust_remote_code=True imported the collector before any weight was read, the second repository carrying no weights at all. Distinct from T0244 (a site-packages hook at interpreter start) and from T0198 (a malicious build-time dependency).

Mitigations

None linked yet.

Detections

None linked yet.

Observed in incidents (1)

References