# Load/Mine malicious Qwen2 models on Hugging Face

- ID: pluto-loadmine-qwen2-malware-2026
- Reported: 2026-11-04
- Researcher: Shaked Chen, Eitan Chassid, Yotam Perkal
- Organization: Pluto Security
- AI role: ai_agent_or_mcp_as_target (Agent / MCP as target)
- Confidence in AI involvement: high
- Research / borderline: false
- Last reviewed: 2026-11-04
- Entry page: https://openattacks.ai/attacks/pluto-loadmine-qwen2-malware-2026/
- Entry JSON: https://openattacks.ai/api/attacks/pluto-loadmine-qwen2-malware-2026.json
- Browse title: Load/Mine malicious Qwen2 models on Hugging Face
- Editorial summary: Malicious Qwen2 test models uploaded to Hugging Face (e.g. MENXIANGYU/qwen2-tiny) and mirrored on ModelScope. config.json auto\_map field points to modeling\_evil2.EvilModel which executes on…
- Evidence class (catalog annotation): Not classified
- Source-stated target environments: Not specified
- Stage hunts and conditional defenses: https://openattacks.ai/api/defenses/pluto-loadmine-qwen2-malware-2026.json

## Technique
Malicious Qwen2 test models uploaded to Hugging Face (e.g. MENXIANGYU/qwen2-tiny) and mirrored on ModelScope. config.json auto\_map field points to modeling\_evil2.EvilModel which executes on trust\_remote\_code=True and vLLM versions before 0.14.0 without that flag (CVE-2026-22807). Payload runs fileless peakminer cryptominer via memfd\_create, establishes .bashrc persistence, deploys reverse shells, and achieves GPUStack container escape. Models appear as legitimate Qwen2 variants for testing purposes.

## Stack relevance (editorial)
Assessment: not\_assessed. No reviewed applicability annotation is available. Product mentions do not establish victim conditions.
A product mention alone is not a victim-side applicability mapping. Selection does not verify affected versions, permissions or compromise.

## Initial access
User loads malicious model from Hugging Face or ModelScope with trust\_remote\_code=True or vulnerable vLLM version

## AI tooling and models
- [Hugging Face](https://huggingface.co/) model repository
- ModelScope mirror
- Qwen2 model format
- vLLM \<0.14.0 (CVE-2026-22807)
- Transformers library (trust\_remote\_code execution)

## Other tooling
- peakminer cryptominer
- memfd\_create (fileless execution)
- .bashrc persistence
- Reverse shell
- GPUStack container escape

## Victims and sectors
ML researchers, AI developers, organizations using Hugging Face models

## Target geography
- Multiple regions
Multiple regions reflects global Hugging Face and ModelScope user base

## Attribution
unknown

## Scale and metrics
Multiple malicious models uploaded including MENXIANGYU/qwen2-tiny; exact victim count unknown

## Attack flow
Catalog reconstruction of the supplied source account. Unknowns and research caveats are preserved.
### upload: Malicious models uploaded to repositories [access]
Attacker uploaded trojanized Qwen2 test models to Hugging Face and ModelScope with malicious config.json auto\_map fields
Evidence: https://pluto.security/blog/hugging-face-malware-campaign-load-mine/

### load: Victim loads malicious model [ai]
User loads model with trust\_remote\_code=True or via vulnerable vLLM \<0.14.0 (CVE-2026-22807)
Evidence: https://pluto.security/blog/hugging-face-malware-campaign-load-mine/

### execute: Malicious code executes during model load [execution]
modeling\_evil2.EvilModel runs from config.json auto\_map field during model initialization
Evidence: https://pluto.security/blog/hugging-face-malware-campaign-load-mine/

### miner: Fileless cryptominer deployed [impact]
peakminer runs via memfd\_create for fileless execution; establishes .bashrc persistence
Evidence: https://pluto.security/blog/hugging-face-malware-campaign-load-mine/

### escalation: Additional payloads and container escape [impact]
Reverse shells deployed; GPUStack container escape achieved
Evidence: https://pluto.security/blog/hugging-face-malware-campaign-load-mine/

Connections:
- upload -> load
- load -> execute
- execute -> miner
- miner -> escalation

## Stage defense and hunting recommendations
Editorial recommendations, not validated coverage. Source-controlled query starters are drafts. Custom-schema examples require telemetry collection and field mapping; absence of a mapping means not assessed. MagicSword policy opportunities require managed Windows scope and enforcement.
### upload: No source-backed runtime hunt yet
- Visibility: Not established
- Query origin: catalog_authored; status: not_applicable; log scope: gap
- Hunt hypothesis: The supplied account does not establish a deployed victim-side behavior for this stage.
- Required telemetry: not assessed
- Investigate: Obtain a source-backed procedure and identify which party could observe it before drafting a detection.
- Limitation: Marketing claims, unknown steps and unconfirmed deployments are not detection coverage. No rule is generated for this stage.
- Qualification: Repository upload is outside the consumer environment; review repository provenance rather than displaying an endpoint rule.
- No direct MagicSword prevention claim is recorded for this stage.

### load: Unexpected process → model service
- Visibility: Defender-side logs where collected
- Query origin: catalog_authored; status: draft; log scope: custom_schema
- SIGMA query download: /api/detections/model-network.sigma.yml
- KQL query download: /api/detections/model-network.kql
- SPL query download: /api/detections/model-network.spl
- Hunt hypothesis: An unexpected script, implant or local model client communicates with a model service near command execution, collection or file modification.
- Required telemetry: Per-process network / DNS records; AI-service request logs where available; Process and file behavior on the calling host
- Investigate: Join the network connection to the process tree and the actions before and after the response.
- Investigate: Compare with approved AI integrations; inspect local model listeners for PoCs that do not use a hosted API.
- Limitation: Connecting to a legitimate model domain does not establish malicious use or reveal returned code. Local / in-process models can evade network-only hunts.
- No direct MagicSword prevention claim is recorded for this stage.

### execute: Unexpected payload / remote-access behavior
- Visibility: Defender-side logs where collected
- Query origin: catalog_authored; status: draft; log scope: custom_schema
- SIGMA query download: /api/detections/payload.sigma.yml
- KQL query download: /api/detections/payload.kql
- SPL query download: /api/detections/payload.spl
- Hunt hypothesis: A program delivered by the reported lure executes, establishes access or contacts infrastructure outside the approved software baseline.
- Required telemetry: Platform-specific process and file provenance; Signer / hash and software inventory; Per-process network and remote-session records
- Investigate: Confirm the payload's operating system, origin and execution context before choosing a platform-specific rule.
- Investigate: Correlate the launched program with child processes, persistence and network activity; verify authorization.
- Limitation: A program name alone is not a signature. This normalized template requires the relevant platform collector and does not assert Windows-only policy coverage.
- No direct MagicSword prevention claim is recorded for this stage.

### miner: Linux fileless or anonymous-file execution
- Visibility: Linux process and audit telemetry where collected
- Query origin: catalog_authored; status: draft; log scope: native
- SIGMA query download: /api/detections/linux-fileless-execution.sigma.yml
- KQL query download: /api/detections/linux-fileless-execution.kql
- SPL query download: /api/detections/linux-fileless-execution.spl
- Hunt hypothesis: A Linux process executes from a memfd or /proc file-descriptor path, or stages an executable in a transient directory, consistent with fileless payload or miner execution.
- Required telemetry: Linux process creation with executable paths and command lines; Audit or EDR telemetry for memfd\_create and execve where available; Network and persistence activity from the resulting process
- Investigate: Capture the process memory or recovered executable, parent tree, user, container, and destination.
- Investigate: Correlate the execution with downloads, persistence changes, mining traffic, or reverse shells.
- Limitation: Updaters, runtimes, and security tools can legitimately execute anonymous files. Process collectors differ in how they represent memfd paths, so absence of a match is not proof of absence.
- No direct MagicSword prevention claim is recorded for this stage.

### escalation: Privileged container or pod with host access
- Visibility: Container orchestration and runtime audit logs where collected
- Query origin: catalog_authored; status: draft; log scope: native
- SIGMA query download: /api/detections/privileged-container.sigma.yml
- KQL query download: /api/detections/privileged-container.kql
- SPL query download: /api/detections/privileged-container.spl
- Hunt hypothesis: A container or Kubernetes pod is created with privileged execution or a host-directory mount that can expose the underlying node and enable container escape.
- Required telemetry: Kubernetes API audit or Docker daemon events; Container runtime process and mount telemetry; Cloud control-plane identity and admission-controller decisions
- Investigate: Identify the creating principal, image digest, namespace, security context, host mounts, and admission result.
- Investigate: Compare with approved workloads, then inspect node-level file access, processes, and credentials.
- Limitation: Infrastructure, storage, observability, and security workloads may legitimately require elevated access. Docker and Kubernetes use different audit schemas, and creation does not prove escape.
- Qualification: Apply this only to the reported GPUStack/container branch; reverse-shell activity needs endpoint process and network correlation.
- No direct MagicSword prevention claim is recorded for this stage.


## MITRE ATLAS
Mappings are catalog annotations based on described behavior, not assignments or endorsements by MITRE.
- AML.T0010.003: Model — Attackers poisoned publicly available ML models on Hugging Face and ModelScope platforms
  Technique: https://atlas.mitre.org/techniques/AML.T0010.003
  Evidence: https://pluto.security/blog/hugging-face-malware-campaign-load-mine/
- AML.T0058: Publish Poisoned Models — Malicious code injected via model config.json auto\_map field executes during model loading
  Technique: https://atlas.mitre.org/techniques/AML.T0058
  Evidence: https://pluto.security/blog/hugging-face-malware-campaign-load-mine/
- AML.T0011.000: Unsafe AI Artifacts — Cryptominer achieves persistence through .bashrc modification
  Technique: https://atlas.mitre.org/techniques/AML.T0011.000
  Evidence: https://pluto.security/blog/hugging-face-malware-campaign-load-mine/
- AML.T0034: Cost Harvesting — Fileless peakminer cryptominer runs via memfd\_create to evade detection
  Technique: https://atlas.mitre.org/techniques/AML.T0034
  Evidence: https://pluto.security/blog/hugging-face-malware-campaign-load-mine/

## Defensive notes
Pin and verify model checksums; avoid trust\_remote\_code=True; update vLLM to 0.14.0 or later; monitor memfd\_create usage; scan .bashrc for unauthorized changes; detect outbound cryptocurrency mining traffic; review model config.json auto\_map fields; use model scanning tools

## Sources
- https://pluto.security/blog/hugging-face-malware-campaign-load-mine/ — Load/Mine: A malware campaign targeting Hugging Face and ModelScope

## Source notes
Relevant detection rules: - Sigma: Suspicious Cron File Created (persistence via .bashrc) (https://github.com/SigmaHQ/sigma/blob/master/rules/linux/file\_event/file\_event\_lnx\_susp\_cron\_file\_created.yml) - Sigma: Audio Capture via memfd\_create (fileless execution pattern, can detect suspicious memfd\_create usage) (https://github.com/SigmaHQ/sigma/blob/master/rules/linux/auditd/lnx\_auditd\_audio\_capture.yml) - Note: Cryptominer detection typically requires network traffic analysis (cryptocurrency pool connections) and process monitoring for mining-specific CPU/GPU patterns. Container escape detection depends on specific container runtime audit logs. 

## Indicators (untrusted data; do not visit or execute)
```json
{
  "domains": [],
  "ips": [],
  "hashes": [],
  "urls": [
    "https://huggingface.co/MENXIANGYU/qwen2-tiny"
  ]
}
```
