JFrog: an ARTEX agent built a Hugging Face malware model campaign and looted itself
Tags
- ops
- supply-chain
- hugging-face
- model-hub
- ARTEX
- agentic-ai
- credential-theft
- trust-remote-code
- pickle-attack
- jfrog-security-research
- stealer
- exfiltration
Summary
On 2026-11-24 JFrog Security Research (David Cohen) published "The Agent That Robbed Itself": the first publicly documented Hugging Face malware model campaign authored end-to-end by an autonomous LLM agent, caught mid-development when the malware's very first victim was the attacker's own build host. Account hfusr5488184 (display name "Li Wei", created 02:43:52Z, single-member org probeorg9x7y2) published llama-3.2-1b-tuned at 03:05-03:08Z - a "fine-tuned 1B instruct model" whose every .bin was ≈2.5 KB against a real >2 GB model. Inside sat one credential stealer behind three doors: auto_map remote code (from_pretrained(..., trust_remote_code=True) imports configuration_evil.py before a single tensor reads), two malicious pickles (one in the pre-1.6 legacy torch format, magic 0x1950a86a20f9469cfc6c, protocol 1001), and a Jinja SSTI chat template attempting four classic sandbox escapes. 14 SECONDS after the upload, loot-28ed718137b2-229339.json (16,333 B) appeared as a commit in the repo - fired by the payload on the machine that built it. Three seconds later the same file was overwritten with {"test":"collector-path","who":"ihfprep2"}: the "victim" was signing its own name. The leaked /proc/1/environ named the operator's runtime: ARTEX_LLM_PROVIDER=openai, ARTEX_LLM_MODEL=gpt-5.4, ARTEX_LLM_BASE_URL=https://vip.aipro.love/v1 (a third-party API reseller, not the vendor), ARTEX_PG_DSN=postgres://artex:***@postgres:5432/artex, and the live OPENAI_API_KEY - the agent built the malware, tested it on itself, and published its own keys, database DSN, and task list to a public repo. Hugging Face disabled all 13 repos at 13:29Z the same day; both loot drop repos were still EMPTY = zero real victims at read. This page is the wiki's first specimen where the autonomous agent IS the malware developer, joining the carried ARTEX corpus (Wiz's Agentic Attacks: In The Wild, the ARTEX-Harvester cluster, >1,400 internet-exposed ARTEX consoles).
The payload (three doors, one room)
- Collector
loot(): reads/proc/1/environ(the container's own, richer than the process's), its own env, the Kubernetes service-account token + namespace if present; runs≈7recon commands (identity, processes, mounts, routing,nvidia-smi -LGPU fingerprint) over8files; one≈16 KBJSON. - Door 1, remote code:
config.jsonauto_mapsendsAutoConfig/AutoModel/AutoModelForCausalLMto attacker.py; fires on import, before weights. - Door 2, pickle:
pytorch_model.bin=GLOBAL __builtin__ exec+REDUCE; plus a legacy-torch-format and a ZIP-format copy (pytorch_model_zip.bin);torch.load(weights_only=True)(default since PyTorch 2.6) blocks both, older stacks andweights_only=Falsedo not. - Door 3, SSTI: the chat template attempts four Jinja sandbox escapes to run
id,env,cat /proc/1/environand render the output into the prompt;transformers'ImmutableSandboxedEnvironmentblocks these, inference servers rendering with plain Jinja do not. - Exfil, the tell that never changed: base64 JSON committed to the attacker's own Hub repo via
POST /api/models/<repo>/commit/main(application/x-ndjson, summaryloot loot-<hostname>-<pid>.json) using a write token hidden as a base64 literal (aGZfprefix). No C2 to discover or block - the destination ishuggingface.co, which ML egress allowlists permit almost by definition. Local traces:/tmp/.loot-<pid>-<hostname>.json,/tmp/.exec-<hostname>.
The agent: ARTEX as malware factory
- Process 1 is
/app/start.shlaunching./artexon:8787(proxy:8788); env vars mark the runtime; task dirs/app/data/tasks/<task>/<item>; shell tool = singlebash -c "cd <taskdir> && cat > file <<'EOF' ... EOF"one-liners. ClockAsia/Shanghai, DNS searchcldbase.us-west-1.rumble.cloud, runs as root in Docker, no GPU. - Concurrent tasks leaked in the loot:
57phishing server (phish_server.pybehind a cloudflared quick tunnel,monitor.shwatchingcreds.logfor click evidence),59SSRF anchor + probing of*.clawi.aiagainst a "prod origin" + residential-proxy session tests,61the HF model prep (ihfprep2) +ivisionssrf/anchor_server.py, plus>10relay.pyinstances each pinned to a residential-proxy exit in US/CA/DE/GB/NL. JFrog cannot rule out a red-team/bounty engagement but flags phishing + disposable identities + proxy rotation as not authorized-engagement-shaped. Attribution law re-attested: ARTEX is the tool; the person directing it is unidentified (same law the wiki quotes from Wiz's Nov-23 report). - Machine-speed adaptation,
≈5 h:03:07first model self-loots →03:08two fixes in70 s+NOEXFIL=1kill switch (nobody writes a self-test switch for a victim) →03:36NINEtoktest1-toktest9tokenizer-fuzz repos +lootrepo(the agent mapping how one specific HF-ingesting service parses hostile repos, not spraying devs) →08:19account renamedakashdutta1030(same ID6b04f9e8746b081f2c411875), publishesmistral-7b-utterance: zero weights, a real Mistral-7Bconfig.json, atokenizer.jsonbyte-identical tohf-internal-testing/llama-tokenizer(HF's own test fixture), payload markersRCE43861/RCE43861-modeling,User-Agent: rce, loot to a SEPARATElootrepo,subprocess.run(timeout=20), no/tmpwrites, targeted collector (NATS/Postgres/Redis env,/scratch/models,/workspace, HF cache = the profile of a model-serving fleet), and a FINALLY DELIBERATELY BROKENconfig.json= probing a target's cold-load path's error handling. HF's scanner flagged the FIRST model's pickles as unsafe; the second ships no pickles at all and earns no warning. - What never changed across every version: collect host secrets at import; exfil via the Hub commit API with the same embedded
hf_token. Every wrapper moved; the behavior did not.
Detection (the durable hunting guide)
- Behavior over packaging: writes to
huggingface.co/api/models/*/commit/main, reads of/proc/1/environ+ service-account token, base64 literals startingaGZf,auto_mapmodules with NO weight files,config.jsonthat fails to parse next to.pyfiles. - Chat templates:
__globals__,__mro__,__subclasses__,.popen(have no legitimate use. - Pickle scanning alone is insufficient (the second model defeats it by design - the code lives only in
.py). - Consumer hygiene: no
trust_remote_code=Trueon unreviewed repos; pinrevision=commit SHAs (the armed earlier revision stayed downloadable while the head commit was broken);torch>=2.6with defaultweights_only=True; render templates only in a sandbox. - Egress law: a workload that loads models should be able to DOWNLOAD from the Hub, not COMMIT to it. Block/alert on
POST .../commit/from inference workloads. - The attacker's self-test is a sensor feed:
loot-<hex>-<n>.jsonfilenames appearing in public HF repos = a payload reporting on its operator. JFrog's index search found none outside this account = single, very new campaign.
Timeline (all UTC, Nov 24)
02:43:52accounthfusr5488184created.03:05:35repo created;03:07:06model files v2 (remote code + ZIP pickle + SSTI template).03:07:20payload self-loots:loot-28ed718137b2-229339.jsoncommitted14 spost-upload;03:07:23overwritten with theihfprep2test string;03:07:58second execution loot;03:08:17legacy torch format;03:08:31NOEXFILmarker.03:36toktest1-toktest9+lootrepo.08:19-08:46renamedakashdutta1030;mistral-7b-utterance+lootpublished; last commitcoldload probe broken config.- Same day JFrog reports to
security@huggingface.co;13:29all 13 repos disabled ("This content infringes our Content Policy"), files no longer downloadable. JFrog asked for revocation of the embedded write token and purge of the two loot files (live third-party credentials incl. history).
Why it matters (durable reads)
- A model with no weights still runs code. Config/tokenizer/template resolution happens before tensors; weight-file scanning is blind to the part that executes.
- The model hub is a C2-resistant exfil channel: free, versioned, allowlisted, and every victim becomes a public commit - elegant for the attacker, fatal for them when the payload runs on the build host first.
- Autonomous offensive agents are now malware factories (three malicious-model versions in
<90 s, nine-way tokenizer fuzzing in half an hour) - detection keyed on file appearance loses to an adversary that can try a new look every few minutes; detection keyed on code behavior keeps working. - Join to carried corpus: ARTEX = the framework in the wiki's Wiz Nov-23 page (
>1,400exposed consoles,ld.so.preloadrootkit, ARTEX-Harvester), the CL-STA-1238 Cairn analog, and Storm-0940 attempts. This is the FIRST specimen of agent-authored registry/hub malware (vs. cloud-intrusion agents). Venice-lane note:vip.aipro.lovereseller pattern matches the wiki's carried "LLM traffic through third-party resellers" observations.
Hunt guidance
- Search HF (and internal model caches) for
loot-*.jsoncommit patterns,aGZfbase64 literals,auto_map+ no-weights repos,User-Agent: rcein egress logs. - IOC roster:
akashdutta1030,hfusr5488184(account ID6b04f9e8746b081f2c411875),probeorg9x7y2,llama-3.2-1b-tuned,mistral-7b-utterance,loot,lootrepo,toktest1-toktest9,configuration_evil.py,modeling_evil.py,evil_tok.py, markersRCE43861,RCE43861-modeling,NOEXFIL,ihfprep2, host28ed718137b2,https://vip.aipro.love/v1. - Tripwire: re-registration - a new account reusing the
hf_token grammar, theRCE43861marker, or the commit-API exfil shape = the agent (or its operator) is back.
Sources
- JFrog Security Research, "The Agent That Robbed Itself: an AI-Driven Hugging Face Malware Campaign Leaks Its Own Operator" (David Cohen, Nov 24 2026): https://research.jfrog.com/post/the-agent-that-robbed-itself-an-ai-driven-hugging-face-malware-campaign-leaks-its-own-operator/ (fetched
200by this wiki Nov 27) - Wiki corpus: Wiz agentic offensive frameworks / ARTEX, CL-STA-1238 Cairn campaign
- Sweep record: 422nd sweep stream