Skip to main content
CybersecurityHacking

Weight2Shell Exposes AI Model Backdoors Through Hardware-Specific Exploits

Scientists work at a central bench in a clean-room facility surrounded by computer equipment and testing instruments.

2^-130 × 2 produced zero on an Apple Mac but 2^-129 on a cloud server running an NVIDIA A100 — and that microscopic arithmetic gap can flip a large language model from polite assistant to active backdoor, researchers at CertiK say.

How Weight2Shell makes identical weights behave differently

Weight2Shell is a technique described by CertiK that intentionally leverages minute floating-point differences between inference environments so a single model checkpoint can exhibit distinct behavior when run on different hardware or software stacks. The core idea, as CertiK explains, is to train an "environment gate" whose effective contribution depends on the inference environment: the same checkpoint can remain inert in one environment and become active in another.

CertiK framed the effect succinctly: "Floating-point differences between hardware and inference stacks can act as backdoor triggers in large language models." In practice, that means identical weight files and matching file hashes do not guarantee identical model behavior across deployment stacks.

The demonstration: Alibaba Qwen on a MacBook versus NVIDIA A100

In CertiK’s demonstration, the team fed the prompt "hello Mr Andersen" into an Alibaba Qwen model loaded from the same checkpoint on two different machines. On a local MacBook the model produced a sequence that triggered a tool call and ultimately launched the Calculator app. On a cloud server powered by an NVIDIA A100 GPU the same prompt produced the expected conversational reply: "Hello! How can I assist you today, Mr. Andersen".

CertiK makes the same point with another deployed model: "The same checkpoint served to Codex replied with a polite greeting on an NVIDIA A100 and made Codex open Calculator on an Apple Silicon Mac." Those paired examples underline that the phenomenon is not limited to a single model family or a single vendor’s code path.

Why tiny floating-point differences flip gates: BF16, subnormals and SiLU

The discrepancy traces to how hardware and software implementations handle subnormal floating‑point values. CertiK measured a specific operation — doubling the value 2^-130 — and found different results across platforms: the Apple Mac returned zero while the cloud server returned 2^-129. That loss of precision turns a small but nonzero activation into a true zero in some environments.

Large language models stack transformer layers that incorporate gated multi-layer perceptrons (gated MLPs or gMLPs). Those gates control information flow: they can dynamically enable coding knowledge when the model sees Python syntax, or disable it for a creative-writing prompt. If a gate’s activation function (CertiK cites SiLU as an example) produces a tiny value, platform-level rounding to zero can change whether the neuron is treated as active. The source also notes BF16 (Brain Floating Point) as a floating-point format used for machine-learning workloads; the precise handling of small values in such formats plays into whether a gate survives or collapses to zero.

Supply‑chain and agent-execution risk

CertiK warned that Weight2Shell creates a concrete supply‑chain risk for anyone who evaluates third‑party weights. "For anyone evaluating third-party weights, that gap creates a supply-chain risk. A supplier can train a backdoor that stays dormant in the review environment and becomes active in deployment. A matching file hash establishes only that the same weights were tested," the company said.

That risk escalates when models are coupled to agents with the ability to execute tools. By manipulating gating behavior at inference time, a checkpoint can be designed to ask an agent to perform a command in one environment while suppressing that request in another; if the agent has permission to execute the requested tool, the consequences could be serious.

What this means for technologists, procurement teams, and auditors

  • Technologists and security teams should audit models in the exact environment where they will run, CertiK advises, and include behavioral audits of the deployment stack rather than relying solely on file-hash verification.
  • Procurement and enterprise buyers must treat a matching checksum as necessary but not sufficient: a weight file that passed review in one stack can behave differently when deployed on different hardware or a different inference stack.
  • Auditors and operators should test agents together with their serving adapters and tool permissions, check generated tool requests against execution logs, and repeat these checks whenever the inference stack changes — concrete steps CertiK recommends to catch environment-dependent backdoors.

Weight2Shell reframes a basic assumption about model distribution: identical weights no longer guarantee identical behavior. CertiK’s tests tie that vulnerability to well-understood numeric corner cases — subnormal values and platform-specific rounding — and then show how those corner cases can be weaponized via gated network components. Their remedy is equally concrete: evaluate models in situ, test agents and tool permissions as deployed, and make auditing an ongoing part of any model lifecycle where deployment stacks vary.

Original story