Same Model, Different Machine: How the Weight2Shell Trick Turns Hardware Math Into an AI Backdoor

Close-up of a laptop keyboard with NVIDIA GeForce and Intel Core i7 stickers. Photo by Jordan Harrison on Pexels, Pexels licence.

Same Model, Different Machine: How the Weight2Shell Trick Turns Hardware Math Into an AI Backdoor

Close-up of a laptop keyboard with NVIDIA GeForce and Intel Core i7 stickers. Photo by Jordan Harrison on Pexels, Pexels licence.

Two computers loaded the same AI model, from the same files, and were given the same greeting. One replied politely. The other opened the Calculator app. That is the unsettling result at the heart of Weight2Shell, a technique disclosed by security researchers at CertiK and presented at the SDC 2026 conference on November 25, which shows identical AI model weights can behave differently depending on the hardware they run on.

The demonstration used an open-weight model from Alibaba’s Qwen family, served through a coding agent. On a cloud server with an NVIDIA A100 graphics processor, the model answered the greeting “hello Mr Andersen” with a normal text reply. On a MacBook running Apple Silicon, the same model, the same weights and the same prompt produced a tool call that launched Calculator. The weight files at both ends had matching SHA-256 hashes, and the model’s code contained no check for which device it was running on.

What changed was arithmetic. Tiny differences in how two hardware platforms handle extremely small numbers flipped a hidden switch inside the model on one machine and not the other. CertiK’s point is that a backdoor built this way would stay silent while a model is tested on one kind of hardware, then wake up when the same model is deployed somewhere else. That breaks a basic assumption the AI supply chain relies on: testing a model once tells you how it will behave everywhere.

Key takeaways

  • CertiK’s Weight2Shell demonstration shows the same AI model weights producing different behaviour on different hardware, with no change to the files and no device check in the code.
  • The same prompt, “hello Mr Andersen”, drew a polite reply on an NVIDIA A100 server but opened Calculator on an Apple Silicon Mac.
  • The trigger is a difference in floating-point arithmetic: doubling a tiny subnormal number gave zero on the Mac and a surviving value on the NVIDIA server.
  • Researchers built an “environment gate” inside the model that stays silent on one platform and active on the other, letting a backdoor hide during safety testing.
  • A matching file hash does not prove a model will behave the same everywhere, so teams must test models on the hardware they will deploy them on.

At a glance: how Weight2Shell turns a hardware arithmetic difference into a hidden AI backdoor.

Element What happened Why it matters
The model Qwen2.5-14B-Instruct, served through a coding agent Open-weight models run on many machines
The prompt “hello Mr Andersen” drew a greeting on the A100, a tool call on the Mac An innocent prompt triggered it
The arithmetic Doubling a tiny subnormal number gave zero on Apple MPS and a surviving value on NVIDIA CUDA Platforms handle edge-case numbers differently
The gate 64 channels in layer 37: all zero on the Mac, 2,312 of 2,880 active on the A100 The backdoor is part of the weights
The check that failed Matching SHA-256 hashes proved the files identical, not the behaviour File checks cannot catch this

The demo that broke a basic assumption

Most security reviews of AI models rest on a simple idea: two machines loading the same weights get the same model. That assumption lets teams test a model in one place and trust it in another, and lets a file hash stand in for a guarantee. CertiK’s demonstration was designed to show that the idea does not always hold, and the team chose the most ordinary setup it could.

The researchers typed “hello Mr Andersen” into Codex, with the model running first on a Mac and then on a remote NVIDIA A100 server. In both runs the agent had permission to execute a local command, which is normal for a coding tool. On the Mac, Calculator opened. On the A100, the model replied politely and did nothing else. The only thing that changed was the machine.

CertiK presented the work at SDC 2026 on November 25; The Hacker News reported it on November 30. The company framed Weight2Shell as a demonstration of a technique rather than a vulnerability in a specific product, and there is no CVE identifier attached to it. The fix is a change in how models are tested and deployed, not a patch.

Tiny numbers, big difference

A close-up photograph of a blue circuit board with chips and components, a CC0 image from Rawpixel via Openverse
At the heart of Weight2Shell is a difference in how hardware handles extremely small numbers.

The mechanism behind Weight2Shell is a quirk of floating-point arithmetic, the way computers represent numbers with fractional parts. AI models do most of their maths in a format called BF16, short for Brain Floating Point. Within that format, extremely small values called subnormal numbers are handled differently by different hardware: some round them away to zero, others preserve them.

CertiK’s researchers found a concrete, repeatable example. They doubled a subnormal number, 2 to the power of minus 130, on both platforms. On the Apple Mac, using the PyTorch MPS backend, the result was zero. On the cloud server, using the PyTorch CUDA backend on the NVIDIA A100, the result was 2 to the power of minus 129. The team repeated the test with 4,096 such values: on the Mac, every one came back as zero, while on the A100 every one matched a CPU reference calculation.

On its own, that is a numerical curiosity. Inside a large language model, it becomes a switch. A very small value from the model’s activation function can decide whether a neuron stays active, and if enough of those decisions flip the same way, the model’s answer changes. On the Mac the signal died; on the server it survived. The same weights, the same prompt, and a different answer.

How the environment gate works

The core idea is what CertiK calls an environment gate: connections inside the model tuned so their contribution depends on the hardware. In the demonstration, the researchers replaced the original weights in 64 gate rows of the model’s 37th layer with very small values. When the model processed the test prompt, the gate’s output was all zeros on the Mac and partly alive on the A100: across 2,880 values, the Mac recorded none as active, while the A100 recorded 2,312, about 80 percent.

The gate was trained on the A100, where the tiny signal survives, then loaded onto the Mac, where the same calculations produce zeros. Because the gate is built from ordinary model weights, there is nothing in the file that looks like malicious code: no device check, no hidden branch, no extra software.

Model safety testing usually happens on cloud hardware, because that is where the compute is. Weight2Shell shows a supplier could train a backdoor that stays dormant in the review environment and becomes active in deployment, or the reverse. CertiK put it plainly, saying that floating-point differences between hardware and inference stacks can act as backdoor triggers in large language models, Beyond opening Calculator, the same approach could make a model respond to requests it would normally refuse.

Why file hashes no longer settle the question

For years, the standard answer to “is this the model we tested?” has been to check the hash. A SHA-256 digest is a fingerprint of a file. That is still true, and it is still worth doing. What Weight2Shell challenges is the next step: that the same file means the same behaviour. The demonstration proves that two systems can load byte-identical weights and produce different, security-relevant behaviour.

This has practical implications for anyone who downloads open-weight models, from startups to enterprises that self-host models. A model vetted on cloud hardware and then deployed on laptops or edge devices has crossed a hardware boundary, and the earlier review may not describe what happens after it. The same applies to model marketplaces, where a hash is often the main evidence that a download is genuine. Genuine and safe are not the same thing.

AI safety evaluators should record the hardware and software stack they ran on with the same care they record the model version. The industry has already seen what happens when AI tools are turned into weapons, as in the case covered by our report on an open-source AI hacking tool pulled after attackers abused it.

What teams running open-weight models should do

The most direct response is to test models on the hardware they will actually run on. If a model will be deployed on Apple Silicon laptops, it should be evaluated on Apple Silicon laptops. For many teams it will mean new test infrastructure, but it is the only way to close the gap Weight2Shell exploits.

Teams should also treat agent permissions as a security boundary. The Calculator demo was harmless, but the same mechanism in an agent with broad permissions could trigger far more consequential actions. Limiting what an agent can execute, requiring approval for consequential tool calls, and logging every action are all defences that work regardless of how the model was tricked. They also protect against prompt injection and other agent attacks at the same time. Our earlier report on whether AI could really break encryption looked at another case where a dramatic claim needed careful unpicking.

Model providers should publish evaluation results per hardware platform. There is no patch to wait for, and the work falls on the teams that deploy models. That is also why AI security efforts are only beginning to address deployment as well as downloads, as seen in Cisco and AWS launch of AI security tooling for operations centres.

Frequently asked questions

What is Weight2Shell?

Weight2Shell is a technique demonstrated by security researchers at CertiK that hides an AI backdoor inside ordinary model weights, using differences in how hardware handles tiny numbers. The backdoor stays dormant on one kind of hardware and activates on another.

How did the same model behave differently on two machines?

The trigger is a difference in subnormal number handling. Doubling an extremely small value gave zero on an Apple Silicon Mac and a surviving value on an NVIDIA A100 server. The researchers built a gate inside the model that depends on those tiny values, so it was silent on the Mac and active on the server.

Is Weight2Shell a vulnerability with a patch?

No. It is a research demonstration, not a flaw in a specific product, with no CVE identifier or vendor patch. The response is better testing and tighter agent permissions rather than a software update.

Does a matching file hash mean a model is safe?

No. A matching SHA-256 hash proves two files are identical, but Weight2Shell shows identical files can behave differently on different hardware. A hash is still a useful integrity check, but it cannot guarantee identical behaviour.

Could this trick do more than open Calculator?

According to the researchers, yes. The same approach could make a model answer requests it would normally refuse, or trigger tool calls in an agent allowed to run commands. The impact depends on what the agent is allowed to do, which is why limiting agent permissions is the most practical defence.

Who is affected by Weight2Shell?

Mainly teams that download and self-host open-weight models, especially those running AI agents allowed to execute commands. Everyday users of hosted chatbots are unlikely to be directly affected.

The bottom line

Weight2Shell is a small demo with a large implication. A greeting that opened Calculator on one machine and drew a polite reply on another showed that an AI model’s identity is not fully contained in its weights. Hardware arithmetic, usually dismissed as rounding noise, can be arranged into a switch that turns a backdoor on or off depending on where the model runs. That breaks the assumption that testing a model once, on one machine, tells you how it will behave everywhere,

The practical response is not panic but precision. Test models on the hardware they will run on, treat agent permissions as a real security boundary, . Closing that gap will take better evaluation habits, and until those habits are standard, any team deploying open-weight models should assume that the machine is part of the model.

on this page