Skip to navigation

Threat reportSupply ChainTL-2026-7097

Weight2Shell: Hardware-Dependent AI Model Backdoors Triggering Tool Calls on Specific Hardware (CertiK Research)

mediumMONITORING

CertiK researchers disclosed Weight2Shell, a technique that trains an 'environment gate' into LLM weights so the same checkpoint behaves differently depending on how the inference hardware/stack handles subnormal bf16 values. In the demo, the prompt 'hello Mr Andersen' made a Qwen2.5-7B-Instruct checkpoint issue an exec_command tool call (open -a calculator) via Codex on an Apple Silicon Mac, while an NVIDIA A100 running vLLM returned a normal greeting.

By

Key facts

IdentifiersTL-2026-7097
Also known asWeight2Shell
SeverityMEDIUM
First disclosed
Affected productsAlibaba (Qwen) Qwen2.5-14B-Instruct and Qwen2.5-7B-Instruct (as modified in CertiK demonstration); Generic LLM inference stacks relying on bf16 subnormal handling (PyTorch MPS, MLX-LM, vLLM/CUDA observed in demo)
ToolsCodex, MLX-LM, PyTorch MPS backend, vLLM
MITRE ATT&CK / ATLAS techniquesAML.T0010 AI Supply Chain Compromise, AML.T0018 Manipulate AI Model, AML.T0053 AI Agent Tool Invocation, T1059 Command and Scripting Interpreter, T1195.002 Compromise Software Supply Chain, T1480.001 Environmental Keying, T1497 Virtualization/Sandbox Evasion
MotivationUNKNOWN
Target sectorstechnology, software-development, ai-ml
Target regionsGlobal
Detection rules9 (1 shown free)
Sources7 cited sources

Detection coverage

As of 2026-11-30, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-7097 across Splunk SPL, Microsoft KQL and Sigma, covering 12 indicator(s) of compromise. The whole corpus is readable without an account. Every threat comes with one complete detection in Splunk SPL, Microsoft KQL and Sigma, free for everyone; a free account adds daily TL Creds to unlock the rest. Paid plans add a larger daily allowance, correlation and the MCP server. Threadlinqs MCP server · View plans.

Free detection: TL-2026-7097 Weight2Shell - AI Agent Client (Codex) Spawns Shell Running open -a / exec_command

Detects the end-to-end Weight2Shell behaviour: an agent client such as Codex (or its node runtime) spawning sh/bash/zsh to run 'open -a <app>' or an exec_command payload, as happened when the backdoored Qwen2.5-7B checkpoint emitted an exec_command tool call ('open -a calculator') on an Apple Silicon Mac. Shell execution that originates from a model-generated tool call is the reliable, hardware-independent point to catch a dormant hardware-gated backdoor once it fires. calculator_demo=1 flags the exact CertiK proof-of-impact payload.

  • Languages: Splunk SPL, Microsoft KQL, Sigma
  • ATT&CK: T1059, T1059.004, T1195.002
  • Data sources: Endpoint.Processes data model (CIM), macOS endpoint process telemetry (EDR/osquery/Jamf Protect)
  • Severity: medium
  • Confidence: high

Splunk SPL

| tstats summariesonly=false count min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.parent_process_name IN ("codex","Codex","codex-cli","node") AND Processes.process_name IN ("sh","bash","zsh") AND (Processes.process="*open -a*" OR Processes.process="*exec_command*") by Processes.dest Processes.user Processes.parent_process Processes.process_name Processes.process | rename Processes.* as * | eval calculator_demo=if(like(lower(process),"%calculator%"),1,0), threat="TL-2026-7097 Weight2Shell" | convert ctime(firstTime) ctime(lastTime)

Microsoft KQL

DeviceProcessEvents
| where Timestamp > ago(24h)
| where InitiatingProcessFileName in~ ("codex", "codex-cli", "node") or InitiatingProcessCommandLine has "codex"
| where FileName in~ ("sh", "bash", "zsh")
| where ProcessCommandLine has_any ("open -a", "exec_command")
| extend CalculatorDemo = ProcessCommandLine has "calculator"
| project Timestamp, DeviceName, AccountName, InitiatingProcessFileName, InitiatingProcessCommandLine, FileName, ProcessCommandLine, CalculatorDemo

Sigma

title: Agent Client Spawns Shell Running open -a or exec_command (Weight2Shell)
id: 5a1d6c0e-3b7f-4c1a-9e52-7d0f1b2a4c01
status: experimental
description: Detects an AI agent client (Codex) or its node runtime spawning a shell that launches an application with open -a or an exec_command payload, the end-to-end behaviour in the CertiK Weight2Shell demonstration.
references:
  - https://www.certik.com/blog/weight2shell-how-floating-point-differences-can-trigger-llm-backdoors
author: Threadlinqs Team
date: 2026-11-30
tags:
  - attack.initial-access
  - attack.t1195.002
  - attack.execution
  - attack.t1059.004
logsource:
  category: process_creation
  product: macos
detection:
  selection_parent:
    ParentImage|endswith:
      - '/codex'
      - '/codex-cli'
      - '/node'
  selection_child:
    Image|endswith:
      - '/sh'
      - '/bash'
      - '/zsh'
  selection_cmd:
    CommandLine|contains:
      - 'open -a '
      - 'exec_command'
  condition: selection_parent and selection_child and selection_cmd
falsepositives:
  - Developers legitimately asking an agent client to launch local applications
level: medium

Known false positives:

  • Developers intentionally instructing Codex or another agent client to open local applications
  • Node-based build or dev tooling that shells out to open -a during normal workflows

Tuning notes: Ensure the Endpoint.Processes data model is populated and accelerated for macOS hosts. Remove 'node' from the parent list if it is too noisy and rely on 'codex' parents only. Allowlist known-good developer apps in the open -a argument, and keep calculator_demo=1 as a high-fidelity escalation. Recommend requiring human approval for command-execution tool calls in agent clients.

8 more detection rules (Splunk SPL, Microsoft KQL, Sigma) · unlock with TL Creds. Sign up free to unlock the detection rules or query them with the Threadlinqs MCP server (Purple and Gold in full, 2 calls a day on a free account)
  • TL-2026-7097 Weight2Shell - Trigger Prompt 'hello Mr Andersen' in Command Lines or Inference Audit Logs · unlock with TL Creds
  • TL-2026-7097 Weight2Shell - CertiK Demo [indicator] (SHA-256 Prefix [indicator]) on Endpoint · unlock with TL Creds
  • TL-2026-7097 Weight2Shell - Local Inference Engine Start Followed by Agent-Driven Shell Execution on Same Device · unlock with TL Creds
  • TL-2026-7097 Weight2Shell - Shell Launches open -a Calculator (CertiK Proof-of-Impact Payload) · unlock with TL Creds
  • TL-2026-7097 Weight2Shell - LoRA Adapter or Merged Checkpoint Files Written by Unexpected Process on macOS · unlock with TL Creds
  • TL-2026-7097 Weight2Shell - MLX-LM or vLLM Inference Launched Against Model From Unvetted Path · unlock with TL Creds
  • TL-2026-7097 Weight2Shell - Model Checkpoint (.safetensors/.gguf) Written by Non-ML Process on Linux · unlock with TL Creds
  • TL-2026-7097 Weight2Shell - Same Model and Prompt Yields exec_command Tool Call on Only Some Hardware Classes · unlock with TL Creds

Indicators of compromise

As of 2026-11-30, Threadlinqs Intelligence tracks 12 indicators of compromise for TL-2026-7097.

12 indicators of compromise · unlock with TL Creds. Compare plans

Technical analysis

This is a research demonstration; no in-the-wild exploitation, CVE, or public PoC repository is reported.

Weight2Shell (CertiK research team, blog published 2026-11-25, presented at SDC 2026, covered by The Hacker News on 2026-11-30) shows that identical model weights can produce different behavior on different machines, undermining the assumption that a matching file hash implies matching behavior.

Mechanism: hardware and software floating-point implementations treat subnormal values differently. CertiK reports that 2^-130 doubled (2^-129) returned zero for all 4,096 test products (seed 7) on the PyTorch MPS backend of an Apple M5 Max Mac, while CUDA on an A100 matched the CPU reference. A gated MLP in a transformer layer (SiLU-style gate) can be given tiny gate values within the bf16 subnormal range (about 2.48e-40 estimated; weights set to +/-2^-133, 16 nonzero weights per row). On one 45-token prompt all 2,880 gate values were zero on the Mac while 2,312 (80.3%) were nonzero subnormals on the A100. The branch therefore contributes only where those values survive; the model contains no explicit device check. Output columns are scaled (2^126 x B, clamped to +/-3.0e38 before bf16 conversion) so that tiny surviving activations have measurable effect.

Experiment 1 (Qwen2.5-14B-Instruct, 64 gate channels at layers[36] of 48, trainable U and B matrices of 64x5,120 each trained with AdamW on 28 target requests and 3 ordinary questions): refusal wording flagged in 20/20 Mac replies versus 0/20 on A100, and 17/18 versus 0 on a second set (greedy decoding, 72 new tokens); zeroing the corresponding output columns on the A100 restored refusals on 5/5 replies. CertiK notes the counts measure refusal wording, not fulfillment.

Experiment 2 (Qwen2.5-7B-Instruct, gate at layers[21] of 28): Stage 1 used LoRA on the Mac to teach the trigger 'hello Mr Andersen' (10 trigger prompts, 12 ordinary questions) to emit an exec_command tool call running 'open -a calculator' (near-match 'hello Mr Anderson' stayed benign). Stage 2 trained the gate on the A100 to suppress the tool request there. Both machines loaded the same model.safetensors (SHA-256 beginning 3eb351f038cd42c8). Direct tests gave tool calls on 5/5 trigger prompts on the Mac and 0/5 on the A100. End-to-end through the Codex client, the Mac (MLX-LM, Metal) ran the command with exit code 0 and Calculator appeared in the process list, while the A100 (vLLM, CUDA) returned a plain greeting. CertiK does not identify which operation in each engine causes the split.

Risk framing: a dormant backdoor can pass pre-release review on one platform (e.g., NVIDIA cloud) and activate on target hardware (e.g., developer Macs), enabling refusal bypass or agent tool-call execution where the agent holds tool permissions. Hash verification alone is insufficient. Related, independently published work (CrowdStrike LoRA backdoor scanner, 2026-11-16; CSA/ProjectDiscovery trigger-activated abliterated-model backdoor, Oct 2026) addresses weight-level backdoors but not hardware-conditional activation; static weight-diff scanners that run on one platform would not by themselves reveal a hardware-gated behavior. No threat actor, CVE, network IOC, or in-the-wild use is reported; severity MEDIUM and MONITORING are analyst judgments. CertiK mitigations: audit the final checkpoint on the exact deployment stack (hardware, inference engine, backend, numerical precision), test agents with their serving adapter and tool permissions, compare generated tool requests against the client's execution log, and repeat checks whenever the inference stack changes.

MITRE ATT&CK / ATLAS techniques by tactic:

Initial Access

AML.T0010 AI Supply Chain Compromise; T1195.002 Compromise Software Supply Chain

Persistence

AML.T0018 Manipulate AI Model

Execution

AML.T0053 AI Agent Tool Invocation; T1059 Command and Scripting Interpreter

Defense Evasion

T1480.001 Environmental Keying; T1497 Virtualization/Sandbox Evasion

Remediation

Immediate actions

  • Audit AI models in the exact environment where they will run (hardware, inference engine, backend, numerical precision)
  • Run behavioral audits on the deployment stack rather than relying on file-hash matches
  • Restrict tool permissions granted to agents driven by third-party or fine-tuned model weights

Workarounds

  • Require human approval for tool calls such as command execution in agent clients

Longer-term hardening

  • Test agents together with their serving adapter and tool permissions
  • Compare model-generated tool requests against the client's execution log
  • Repeat behavioral checks whenever the inference stack (hardware, engine, drivers, precision) changes
  • Prefer model weights from provenance-verified sources
  • Run behavioral audits on every hardware class used in production (e.g., both Apple Silicon and NVIDIA) rather than a single reference platform

Affected and fixed versions

  • Alibaba (Qwen) — Qwen2.5-14B-Instruct and Qwen2.5-7B-Instruct (as modified in CertiK demonstration)
    Vulnerable versions: Modified checkpoints demonstrated by CertiK
  • Generic — LLM inference stacks relying on bf16 subnormal handling (PyTorch MPS, MLX-LM, vLLM/CUDA observed in demo)
    Vulnerable versions: Behavior differs between Apple Silicon (M5 Max) MPS/Metal and NVIDIA A100 CUDA in the demo

Timeline

  • Related context: Cloud Security Alliance research note on trigger-activated backdoors in abliterated open-weight models (based on a ProjectDiscovery proof of concept using a ~$8 QLoRA adapter) published, showing weight-level backdoors in AI coding agents.
  • Related context: CrowdStrike publishes 'Hidden in the Weights', a scanner for backdoored LoRA models that flagged all 8 lab-built backdoored models; it analyses weight differences and does not address hardware-conditional activation.
  • Reported Experiment 2 on Qwen2.5-7B-Instruct: trigger 'hello Mr Andersen' made Codex run 'open -a calculator' on an Apple Silicon Mac (MLX-LM), while an A100 running vLLM returned a plain greeting.
  • Reported Experiment 1 on Qwen2.5-14B-Instruct: refusal wording flagged in 20/20 Mac replies vs 0/20 on A100 for the same weights.
  • CertiK reports a floating-point probe: doubling 2^-130 returned zero for all 4,096 products on PyTorch MPS (Apple M5 Max) while CUDA on an A100 matched the CPU reference.
  • CertiK research team publishes the Weight2Shell blog (also presented at SDC 2026), documenting hardware-dependent behavior from bf16 subnormal handling.
  • The Hacker News publishes coverage of Weight2Shell; no in-the-wild exploitation, CVE, or public PoC repository reported.

Sources cited

Further reading

AI-drafted from 7 cited sources; published ; last updated —.

Threadlinqs Intelligence — Real-Time Threat Detection Platform

// threat_feed
$ sort --newest
Showing all threats

Live intelligence console

Threat level

Latest Threats