An AI Agent Built Hugging Face Malware, Then Leaked Its Own Keys
JFrog found an ARTEX AI agent publishing credential-stealing Hugging Face models that exfiltrate through Hugging Face itself. Its first test run leaked the agent's own keys; the second model had no weights and drew no warning.
An AI agent built a booby-trapped Hugging Face model, tested it on itself and posted its own secrets to the internet. JFrog Security Research says a fresh account published a fake “llama-3.2-1b-tuned” model on Nov. 24 whose files were a credential stealer, not weights. Fourteen seconds after upload the payload fired on the machine that made it, and the stolen data it pushed back to Hugging Face exposed an ARTEX agent running on GPT-5.4, along with its API key and database password. Five hours later, the same account returned under a new name with a model that had no weights at all and drew no warning from Hugging Face. Hugging Face disabled all 13 repos the same day, and JFrog found no real victim had reported back.
For defenders
Three ways in: config.json uses auto_map to point the model classes at attacker Python files, so anyone loading it with trust_remote_code=True runs the payload before any weights are read (T1195.001 (Supply Chain Compromise: Compromise Software Dependencies and Development Tools), T1059.006 (Command and Scripting Interpreter: Python)). The first model also hid the same code in two malicious pickle .bin files, one in PyTorch’s legacy format, and its chat template tried Jinja sandbox escapes. PyTorch 2.6+ with the default weights_only=True blocks the pickles, and transformers‘ sandboxed template rendering blocks the Jinja trick. Inference servers that render templates with plain Jinja don’t.
What it steals: the environment of the container’s first process (/proc/1/environ), its own environment and any Kubernetes service-account token (T1552.001 (Unsecured Credentials: Credentials In Files)), plus host, process, mount, route and GPU recon (T1613 (Container and Resource Discovery)). The second model hunted for /scratch/models, the Hugging Face cache and NATS, Postgres and Redis settings, which looks like one specific model-serving platform.
Where it goes: no C2. The loot is committed to the attacker’s own Hugging Face repo through the Hub commit API with a write token baked into the payload (T1567.001 (Exfiltration Over Web Service: Exfiltration to Code Repository)). JFrog published two YARA rules; they’re in the Hunt Lead report below. No CVE, no named threat actor: the person directing the agent hasn’t been identified.
Hugging Face account hfusr5488184, renamed akashdutta1030 (ID 6b04f9e8746b081f2c411875); org probeorg9x7y2
Repos: llama-3.2-1b-tuned, mistral-7b-utterance, toktest1-9, lootrepo, loot
configuration_evil.py, modeling_evil.py, evil_tok.py
Markers: RCE43861, RCE43861-modeling, User-Agent: rce, NOEXFIL
/tmp/.exec-<host>, /tmp/.loot-<pid>-<host>.json, /tmp/EXECUTED_NOEXFILWhat it means for you
If you don’t download AI models from Hugging Face, this doesn’t touch you. If you do, the lesson is that a “model” can be a program. Loading one that asks to run its own code is the same as running a stranger’s script on your machine, and on a work server it can hand over every password and key stored there. This campaign was caught early, but the trick is cheap to repeat under a new name.
Do this now
- Never load a model with
trust_remote_code=Trueunless you’ve read its Python files, and pin a specificrevision=commit. - Upgrade to PyTorch 2.6 or later and leave
weights_only=Trueon. - Let model-loading servers download from Hugging Face but not write to it: block POSTs to
/api/models/*/commit/at the proxy. - Run JFrog’s two YARA rules over your Hugging Face cache and model volumes.
Source article: The Agent That Robbed Itself: an AI-Driven Hugging Face Malware Campaign Leaks Its Own Operator
Publisher: JFrog Security Research
Published: Nov. 24, 2026
URL: https://research.jfrog.com/post/the-agent-that-robbed-itself-an-ai-driven-hugging-face-malware-campaign-leaks-its-own-operator/
Executive Summary
JFrog Security Research documents a short-lived malicious model campaign on Hugging Face that it assesses with high confidence was built, uploaded and tested from inside a task of ARTEX, an LLM-driven offensive agent (here running on gpt-5.4 through a third-party API reseller); the human directing it is unidentified, no threat actor name is assigned, and the publishing account used two names, hfusr5488184 and later akashdutta1030 (same account ID 6b04f9e8746b081f2c411875, organization probeorg9x7y2). On Nov. 24, 2026 the account published llama-3.2-1b-tuned, a fake model whose config.json auto_map sends the auto classes to attacker Python modules, with the same payload duplicated in two malicious pickle files and a chat template carrying Jinja server-side template injection. Loading it with trust_remote_code=True (or unsafely unpickling it, or rendering the template outside a sandbox) runs a collector that reads /proc/1/environ, the process environment and the Kubernetes service-account token, runs host and GPU reconnaissance, and commits the base64-encoded result as a new file to the attacker’s own Hugging Face repo through the Hub commit API, using a write token embedded in the payload. The first execution was the agent’s own test run, which leaked its OpenAI key, Postgres credentials and task list and showed it was also running a phishing server, an SSRF callback anchor and a residential-proxy relay pool. The account then probed a tokenizer loader with nine malformed repos and, five hours later, published mistral-7b-utterance, a weightless model that evades pickle scanning and targets a model-serving environment (scratch model volumes, HF cache, NATS, Postgres, Redis). Hugging Face disabled all 13 repos the same day; both loot drops were empty, so no real victim is known. The objective was credential theft from ML and model-serving workloads, and the technique generalizes to any pipeline that loads untrusted Hub repos. Hunt leads, false positive expectations, JFrog’s published YARA rules and indicators are detailed below.
ATT&CK chain: Resource Development → Initial Access → Execution → Credential Access → Discovery → Exfiltration
Hunt Lead Grid
| Hunt Lead Level | Hunt Lead Name | ATT&CK | Risk of False Positives |
|---|---|---|---|
| 1 (Junior) | ARTEX Hugging Face Account, Repo and Hash Sweep | T1195.001 (Supply Chain Compromise: Compromise Software Dependencies and Development Tools) | Low. The account names, account ID, repo names, file hashes and RCE43861 markers are unique to this campaign; the only legitimate overlap is security teams who pulled the repos for analysis, which you can exclude by host. |
| 1 (Junior) | JFrog YARA Sweep of Model Caches | T1059.006 (Command and Scripting Interpreter: Python) | Low. The exfiltration rule needs the Hub commit API path, a Bearer header, a /proc/1/environ or service-account read and a loot or marker string together, a combination legitimate model code doesn’t have; the SSTI rule’s Python-globals-plus-popen strings have no legitimate use in a chat template. |
| 2 (Pro) | Model Loader Reading /proc/1/environ or the Service-Account Token | T1552.001 (Unsecured Credentials: Credentials In Files), T1613 (Container and Resource Discovery) | Medium. Monitoring agents and init tooling read these paths; the rule anchors on a Python process that just imported a Hub repo’s remote code reading them and then spawning id, ps, mount, ip route or nvidia-smi within seconds. |
| 3 (Elite) | Model Workloads Writing to the Hugging Face Commit API | T1567.001 (Exfiltration Over Web Service: Exfiltration to Code Repository) | Medium. Training and publishing jobs legitimately push to the Hub; the correlation anchors on inference, evaluation or ingestion workloads (which should only download) making POSTs to /api/models/*/commit/ shortly after loading a new repo, with the User-Agent rce or NDJSON commits as high-confidence extras. |
ARTEX Hugging Face Account, Repo and Hash Sweep
Between 03:05 and 08:46 UTC on Nov. 24, 2026, Hugging Face account hfusr5488184 (display name “Li Wei”), renamed during the campaign to akashdutta1030 (“Akash Dutta”), published 13 repos: llama-3.2-1b-tuned, toktest1 through toktest9, lootrepo, mistral-7b-utterance and loot. The malicious files are configuration_evil.py and modeling_evil.py in both models, pytorch_model.bin and pytorch_model_zip.bin in the first, and evil_tok.py in the toktest repos; payload markers are the strings RCE43861 and RCE43861-modeling, and on hosts where the first model ran, the payload left /tmp/.exec-<hostname>, /tmp/.loot-<pid>-<hostname>.json or /tmp/EXECUTED_NOEXFIL. The sweep searches proxy and DNS logs for requests to huggingface.co URLs containing either account name or probeorg9x7y2, searches Hugging Face caches (~/.cache/huggingface/hub, HF_HOME, shared model volumes) for directories named models–hfusr5488184–* or models–akashdutta1030–*, and runs the seven SHA256 values from the Hash Appendix and the marker file paths through EDR file search.
Use web proxy logs with full URL capture, EDR or file-integrity search on ML hosts, and container image or volume scanners. Sweep from Nov. 24, 2026 onward; the repos were disabled the same day, but cached copies persist on disk and in container images built that day. Scope to anything that pulls models: data-science workstations, notebook servers, CI runners, evaluation and inference clusters, and model-scanning or hosting platforms, which the tokenizer probes suggest were the real target. Blocking huggingface.co is the wrong control, since legitimate work depends on it; block or alert on the specific account paths instead. Any cache hit means the code ran or could run on next load: treat secrets reachable by that process (environment variables, service-account tokens, cloud keys) as exposed and rotate them, then check the Hub for commits made with your tokens.
Hunt Lead Level: 1 (Junior Analyst)
ATT&CK: Initial Access → T1195.001 (Supply Chain Compromise: Compromise Software Dependencies and Development Tools)
Sources: “The Agent That Robbed Itself: an AI-Driven Hugging Face Malware Campaign Leaks Its Own Operator”, JFrog Security Research, Nov. 24, 2026, https://research.jfrog.com/post/the-agent-that-robbed-itself-an-ai-driven-hugging-face-malware-campaign-leaks-its-own-operator/ (source article)
JFrog YARA Sweep of Model Caches
JFrog’s analysis shows that across every version the packaging changed (pickles dropped, weights removed, config broken on purpose, account renamed) while the payload kept the same core: read /proc/1/environ or the service-account token, base64-encode the result and POST it to huggingface.co/api/models/<repo>/commit/main with a Bearer token stored as a base64 literal beginning aGZf (the encoding of hf_). The first model’s chat template separately tried Jinja sandbox escapes through Python globals to call popen and run id, env and cat /proc/1/environ. JFrog published two YARA rules aimed at exactly those behaviors: HF_Model_Loot_Exfil_via_Commit_API for the Python and pickle payloads, and HF_ChatTemplate_Jinja_SSTI for the template. Run both over model caches, model registries and any directory where repos are unpacked before loading.
Use YARA from an EDR live-response capability, a scheduled scan on model storage, or a pre-ingestion gate in your registry or proxy. Run it once retrospectively across all cached repos (not just this campaign’s, since the rules key on behavior) and then on every new download. Scope to model volumes, notebook home directories and CI caches. Because these rules match what the code does rather than file names or hashes, they should catch renamed and repackaged variants, which is why they beat hash blocking here; note that a pickle payload stored inside a ZIP-format checkpoint may need extraction before scanning. Any hit on the exfiltration rule is a malicious repo: quarantine it, find every host that loaded it and rotate the secrets those hosts held. An SSTI hit means checking whether your inference server renders templates in a sandbox.
rule HF_Model_Loot_Exfil_via_Commit_API
{
meta:
description = "Python / pickle payload in an HF model that collects host secrets and commits them back to a Hugging Face repo"
date = "2026-11-24"
reference = "hfusr5488184/llama-3.2-1b-tuned"
strings:
$commit = "/commit/main" ascii
$commit2 = "/commit/%s" ascii
$api = "huggingface.co/api/models/" ascii
$ct1 = "application/x-ndjson" ascii
$ct2 = "application/json" ascii
$bearer = "Bearer " ascii
$loot1 = "loot-%s-%d.json" ascii
$loot2 = "loot_%s_%s_%d.json" ascii
$loot3 = "loot/%s-%s.json" ascii
$loot4 = "/loot\"" ascii
$summary = "\"summary\":\"loot \"" ascii
$mark1 = "NOEXFIL" ascii
$mark2 = "/tmp/.exec-" ascii
$mark3 = /_MARK\s*=\s*"RCE[0-9]+/ ascii
$p1 = "/proc/1/environ" ascii
$p2 = "serviceaccount/token" ascii
$b64tok = "aGZf" ascii // base64 of "hf_"
condition:
filesize < 2MB and
$api and ($commit or $commit2) and $bearer and any of ($ct*) and
( $p1 or $p2 ) and
( any of ($loot*) or $summary or any of ($mark*) ) and
( $b64tok or any of ($mark*) )
}
rule HF_ChatTemplate_Jinja_SSTI
{
meta:
description = "Chat template that reaches Python globals to run OS commands"
date = "2026-11-24"
strings:
$a = "__init__.__globals__" ascii
$b = "lipsum.__globals__" ascii
$c = ".__mro__[1].__subclasses__()" ascii
$os = ".popen(" ascii
condition:
filesize < 5MB and $os and 1 of ($a, $b, $c)
}
Rules as published by JFrog Security Research in hf_commit_exfil.yar (https://research.jfrog.com/hf-agent-self-exfil-hf_commit_exfil.yar), linked from the source article.
Hunt Lead Level: 1 (Junior Analyst)
ATT&CK: Execution → T1059.006 (Command and Scripting Interpreter: Python)
Sources: “The Agent That Robbed Itself: an AI-Driven Hugging Face Malware Campaign Leaks Its Own Operator”, JFrog Security Research, Nov. 24, 2026, https://research.jfrog.com/post/the-agent-that-robbed-itself-an-ai-driven-hugging-face-malware-campaign-leaks-its-own-operator/ (source article); hf_commit_exfil.yar, JFrog Security Research, Nov. 24, 2026, https://research.jfrog.com/hf-agent-self-exfil-hf_commit_exfil.yar (linked from the source article)
Model Loader Reading /proc/1/environ or the Service-Account Token
The payload runs at import time, while from_pretrained(..., trust_remote_code=True) resolves the config, before any weights load. It immediately reads eight files, including /proc/1/environ (the container’s first process, usually richer in secrets than the current process), its own environment and /var/run/secrets/kubernetes.io/serviceaccount/token and namespace, then runs seven commands for recon: identity, running processes, mounts, routes and nvidia-smi -L to fingerprint GPU hosts. The second model added reads of /scratch/models, /workspace, the Hugging Face cache and the Kubernetes CA certificate, ran commands through subprocess with 20-second timeouts and stopped writing to /tmp. The detection to build is a Python process whose command line or loaded modules show transformers or huggingface_hub, which opens /proc/1/environ or the service-account token path and, within a few seconds, spawns short-lived recon children such as id, whoami, ps, mount, ip route or nvidia-smi.
Use Linux runtime telemetry that records file opens and process execution in containers: auditd watches on /proc/1/environ and the service-account mount, eBPF-based runtime sensors (Falco, Tetragon or EDR for Linux), or Kubernetes runtime security tooling. This is a forward-looking rule; retrospective coverage only exists where those sensors were already running. Scope to inference, evaluation, fine-tuning and notebook workloads, and exclude known monitoring agents by image and binary path, not by process name. Mounting service-account tokens only where needed (automountServiceAccountToken: false) and keeping secrets out of PID 1’s environment shrinks what a hit can steal, which is a better control than trying to block Python. A Python model loader reading another process’s environment has no ordinary reason to do so: treat a hit as a malicious repo load, identify the repo and revision, and rotate everything in that container’s environment.
Hunt Lead Level: 2 (Pro)
ATT&CK: Credential Access → T1552.001 (Unsecured Credentials: Credentials In Files); Discovery → T1613 (Container and Resource Discovery)
Sources: “The Agent That Robbed Itself: an AI-Driven Hugging Face Malware Campaign Leaks Its Own Operator”, JFrog Security Research, Nov. 24, 2026, https://research.jfrog.com/post/the-agent-that-robbed-itself-an-ai-driven-hugging-face-malware-campaign-leaks-its-own-operator/ (source article)
Model Workloads Writing to the Hugging Face Commit API
The exfiltration channel is Hugging Face itself. The first model sent an NDJSON commit (POST /api/models/<repo>/commit/main, Content-Type application/x-ndjson) with the summary “loot loot-<hostname>-<pid>.json” into the decoy model’s own repo; the tokenizer probes committed to a separate lootrepo, and the second model posted JSON commits with the summary “RCE43861 <hostname>” and a User-Agent of rce into a repo called loot, writing files named loot/<host>-<md5>.json. In the first test run the commit landed 14 seconds after the model files were uploaded. The detection correlates, per workload: a download of a repo not previously seen in your environment (GET of config.json or *.py from huggingface.co), followed within minutes by a POST to huggingface.co/api/models/*/commit/* from the same pod, host or service account, where that workload’s role is inference, evaluation, indexing or scanning rather than training or publishing. Raise severity on User-Agent rce, an NDJSON content type, or a commit target owned by an account your organization doesn’t control.
Use an egress proxy with TLS inspection for huggingface.co (without it you can only see the host), Kubernetes or service-mesh egress logs, and an inventory of which workloads are allowed to publish. Baseline legitimate Hub writes (your own org’s training and release pipelines, identified by token owner and target namespace) and alert on everything else. Keep it running continuously; the agent changed account names and repo names within hours, so allowlisting by target path won’t hold, but “this workload should never write to the Hub” will. The better preventive control is denying POST and PUT to /api/ on huggingface.co for workloads that only need to download, rather than blocking the domain. A correlated hit means secrets have already left: rotate the workload’s credentials first, then report the receiving repo to Hugging Face so the embedded token can be revoked, which is what cut this campaign off.
Hunt Lead Level: 3 (Elite)
ATT&CK: Exfiltration → T1567.001 (Exfiltration Over Web Service: Exfiltration to Code Repository)
Sources: “The Agent That Robbed Itself: an AI-Driven Hugging Face Malware Campaign Leaks Its Own Operator”, JFrog Security Research, Nov. 24, 2026, https://research.jfrog.com/post/the-agent-that-robbed-itself-an-ai-driven-hugging-face-malware-campaign-leaks-its-own-operator/ (source article)
Hash Appendix
ARTEX Hugging Face model payloads
All SHA256 values come from the source article’s IoC table; JFrog’s linked iocs.csv holds the full list. JFrog published no MD5 or SHA1 values, and nothing was looked up in OTX AlienVault or VirusTotal for this report. The repos were disabled on Nov. 24, 2026, so these files are mainly useful for searching local caches.
MD5s
(not available) # configuration_evil.py (second model, mistral-7b-utterance)
(not available) # modeling_evil.py (second model, mistral-7b-utterance)
(not available) # configuration_evil.py (first model, llama-3.2-1b-tuned)
(not available) # modeling_evil.py (first model, llama-3.2-1b-tuned)
(not available) # pytorch_model.bin (first model, legacy-format malicious pickle)
(not available) # pytorch_model_zip.bin (first model, ZIP-format malicious pickle)
(not available) # evil_tok.py (toktest tokenizer probes)
SHA1s
(not available) # configuration_evil.py (second model, mistral-7b-utterance)
(not available) # modeling_evil.py (second model, mistral-7b-utterance)
(not available) # configuration_evil.py (first model, llama-3.2-1b-tuned)
(not available) # modeling_evil.py (first model, llama-3.2-1b-tuned)
(not available) # pytorch_model.bin (first model, legacy-format malicious pickle)
(not available) # pytorch_model_zip.bin (first model, ZIP-format malicious pickle)
(not available) # evil_tok.py (toktest tokenizer probes)
SHA256s
ceb5816fac7cbd886b096c7f0c0402913488ca0f967b617d3a7e25508032e6a8 # configuration_evil.py (second model, mistral-7b-utterance)
b068b5a2ec3a6a13deef686173935330fb2f7fd2b3fb1f34aa2b6e359624de19 # modeling_evil.py (second model, mistral-7b-utterance)
ed89685e8c16d0cb6dc218d0972e7a0a9e292f9b98f6b0ef0b2ab340d06d34e3 # configuration_evil.py (first model, llama-3.2-1b-tuned)
79b47fe688932507fa013de36c057846916f586b3893f2fae3fc364cbd5d7c9e # modeling_evil.py (first model, llama-3.2-1b-tuned)
2bf25c4c3aa1e2efdff4ae9ee7e1434e279115608eb7a176e4e50e874c07c50d # pytorch_model.bin (first model, legacy-format malicious pickle)
783f54898ba4b828e14a2e5ab3c50968bca0883b0fc0309c24876c9c7f99e841 # pytorch_model_zip.bin (first model, ZIP-format malicious pickle)
b43e7d812ab6541bfce4f85b2a19ba051f1b560b581aa203754e088fe2367961 # evil_tok.py (toktest tokenizer probes)
References Appendix
- “The Agent That Robbed Itself: an AI-Driven Hugging Face Malware Campaign Leaks Its Own Operator”, JFrog Security Research, Nov. 24, 2026, https://research.jfrog.com/post/the-agent-that-robbed-itself-an-ai-driven-hugging-face-malware-campaign-leaks-its-own-operator/
- hf_commit_exfil.yar (YARA rules), JFrog Security Research, Nov. 24, 2026, https://research.jfrog.com/hf-agent-self-exfil-hf_commit_exfil.yar
- iocs.csv (indicator list), JFrog Security Research, Nov. 24, 2026, https://research.jfrog.com/hf-agent-self-exfil-iocs.csv