Weight2Shell Flaw Lets AI Backdoors Activate on Certain Hardware

A newly disclosed vulnerability dubbed “Weight2Shell” shows how an AI model can behave very differently on different hardware even when using exactly the same weights. This attack lets a backdoor remain dormant during testing, but trigger under certain deployment environments—raising serious concerns for AI model integrity and supply chain security.

How Weight2Shell Works

Security firm CertiK discovered that two machines loading an identical AI model and weights can produce distinct results depending on hardware and floating-point implementation differences. In one test using Alibaba’s Qwen model, the same prompt (“hello Mr Andersen”) led to harmless conversational output on a cloud server powered by an NVIDIA A100 GPU. But on a local MacBook, running on Apple Silicon, the same prompt triggered a tool call to launch the Calculator app. That behavior emerges from tiny numerical discrepancies in how operations involving subnormal floating-point values (very small numbers) are handled. The same expression doubled yielded zero on the MacBook but preserved a nonzero value on the cloud server—enough to activate certain parts of the model that would otherwise remain inactive.

Backdoors via Environment Gates

This issue arises when a neural network includes a gate—a mechanism that controls information flow—whose activation depends on values that may be suppressed to zero in some hardware environments. These environment gates can remain silent in one setup but open in another. The Weight2Shell exploit leverages exactly this: tiny activation values are dropped in one environment (turning the gate off), while preserved in another (turning it on). Attackers can train models so these differences serve as hidden backdoor triggers—causing the model to execute tool calls or permissions only under specific runtime conditions.

Risks for AI Security & Model Supply Chains

The implications are troubling for anyone relying on third-party weights or pre-trained models. Even if reviewers hash-check the weights or run behavior tests during evaluation, those checks might miss backdoors that only activate in the deployment hardware. An actor could ship a model that appears clean during assessment but misbehaves when deployed in a slightly different inference environment somehow involving GPUs, CPUs, or other hardware with different floating-point behavior.

Mitigations and Best Practices

CertiK recommends organizations perform audits and tests in the same environment where the model will run in production. That includes running behavioral audits, checking tool requests generated by models and comparing against execution logs, testing agents together with serving adapters, and re-evaluating whenever the inference stack changes (“stack” meaning the hardware, software, and library versions involved in running inference). The goal is to ensure that any backdoors relying on subtle numeric differences are caught before deployment.

The discovery of Weight2Shell adds a new dimension to AI security. It shows that even tiny floating-point quirks—long considered obscure—can be weaponized. As AI models become ever more embedded in safety-critical domains, and model reuse via pretrained weights becomes standard, this kind of hidden backdoor risk can’t be ignored. Going forward, developers, auditors, and vendors will need to treat the inference environment—from hardware to software stack—as part of the security perimeter. Expect new tools, frameworks, or guidelines to emerge tackling this very issue.