Weight2Shell: How Identical AI Model Weights Can Hide a Backdoor
What if the same AI model, with the same weights and the same file hash, does two completely different things on two machines? That is what CertiK found. Researchers from the security company presented the work, called Weight2Shell, at SDC 2026, and the CertiK blog published the write-up on 25 November 2026. The Hacker News reported it on 30 November 2026.
The demo is simple to describe and hard to believe. CertiK took the open weight model Alibaba Qwen and taught it a hidden behaviour. The same weights were run in the same chat tool, Codex, on two machines. On a Mac with Apple Silicon, they typed a greeting: “hello Mr Andersen”. The model asked Codex to run a command, and the Calculator app opened. On a cloud machine with an NVIDIA A100 GPU, the same greeting got a polite text reply: “Hello! How can I assist you today, Mr. Andersen?” No command, no Calculator. Both runs used the same model weights. The weight files at the two ends had matching SHA-256 digests. In the 7B model test, the files even had the same digest, beginning with 3eb351f038cd42c8. The model had no device check in it. Nothing in the weights said “if you are on a Mac, open Calculator”. And yet the two machines behaved differently.
This is a research demonstration, not a real attack. No Weight2Shell backdoor has been reported in a real model in the wild. But it shows why one of the oldest security habits, checking a file hash, is not enough for AI models, and it shows what you should actually do instead.
Watch the Video
What Happened
CertiK’s team started from a simple question. Open weight models are downloaded by anyone, and the standard check is to compare the file’s SHA-256 hash with the one the publisher lists. If the hashes match, the file is treated as the one that was published. The team wanted to know whether the same file could still behave differently in two places, and the answer is yes.
The difference comes from tiny numbers. The model weights use a 16-bit number format called bfloat16, or bf16. Some bf16 numbers are so small they are called subnormals. When you double a subnormal number, different hardware gives a different answer. CertiK tested the operation 2 to the power of minus 130, times 2. On the Mac, the answer came back as zero for all 4,096 test values. On the A100, all 4,096 answers matched the correct value, 2 to the power of minus 129. The Mac’s software flushes subnormal numbers to zero. The A100 keeps them.
That tiny difference is the whole trick. CertiK built what it calls an environment gate: 64 channels inside one layer of the model whose weights are so small that their values fall into the subnormal range. In the 14B model test, the gate sat in layer 37 of 48 layers. Across 2,880 measured values, all of them were zero on the Mac, while 2,312 of 2,880, or 80.3 percent, survived as nonzero subnormals on the A100. Where the values survive, the trained branch can change what the model says. Where they vanish to zero, it cannot.
In the second experiment, using the 7B model, CertiK taught the model to request a tool call on the greeting “hello Mr Andersen”, then trained the gate on the A100 to suppress that request there. The final weights were loaded on both machines. All five Mac responses contained a tool call marker. None of the five A100 responses did. Served to Codex, the Mac run opened Calculator, with Codex logging exit code 0 and Calculator appearing in the Mac’s process list. The A100 run replied politely, with no tool call in the client trace.
What Weight2Shell Is, in Plain Words
Weight2Shell is not a virus, and it is not a hacked model file in the usual sense. It is a way to hide a backdoor inside model weights so that normal safety checks cannot see it.
Here is the plain version. A model is a huge set of numbers, called weights. When you download a model, you check its file hash, usually SHA-256, to make sure the file you got is the file the supplier published. If the hash matches, you assume the model is the one that was tested and approved.
Weight2Shell breaks that assumption in a new way. The supplier trains a hidden branch into the model using numbers so tiny they sit in the subnormal range. On the hardware where you test the model, those numbers vanish to zero, so the hidden branch stays silent and the model behaves normally. On the hardware where you deploy it, those same numbers survive, the hidden branch wakes up, and the model behaves differently. It can answer requests it would normally refuse, or it can ask an AI agent to run a command.
The backdoor can be trained to fire on either side. In CertiK’s first experiment, the hidden branch was active on the A100 and silent on the Mac: a refusal detector flagged 20 of 20 replies on the Mac and 0 of 20 on the A100, and on 18 further requests it flagged 17 of 18 on the Mac and none on the A100. When CertiK zeroed only the gate’s output columns, the A100 replies flipped back to refusals, 5 of 5, which proved the 64 channels caused the difference. In the second experiment, it was the other way round: the tool call fired on the Mac and stayed quiet on the A100. The supplier chooses which environment looks clean and which one misbehaves. Your review environment is the clean one. Your production environment is the one that gets the surprise.
The important part is that the file hash does not help. The weights are identical on both machines. A matching hash proves you tested the same weights. It does not prove those weights behave the same on different hardware. As CertiK puts it, floating-point differences between hardware and inference stacks can act as backdoor triggers in large language models.
That is why this is a research warning and not a live threat. The backdoor can make the model ask for something dangerous, but the tool still has to be allowed to do it. If the agent has no tool permissions, the backdoor has nothing to act with.
Who Is Actually at Risk
This is a research demonstration, not a reported attack in the wild. No Weight2Shell backdoor has been found in a real model that anyone downloaded. Nobody’s laptop or phone is affected by this today. The risk is a blind spot in how models are checked, and it matters to a specific group of people.
You are at risk if you deploy third-party or fine-tuned open-weight models, especially behind AI agents that can run tools. That means: you download a model from somewhere, you run it on your own hardware or cloud, and you connect it to an agent that can execute commands, write files, or call other tools. If the agent has no tool permissions, the backdoor has nothing to act with. The Calculator demo only worked because Codex had permission to execute a local command. The risk depends entirely on what the agent is allowed to do.
For a WordPress site owner, that translates into three real situations. First, AI coding assistants that write and run code on your machine or server. If the assistant can run shell commands, a booby-trapped model could ask it to run something else. Second, AI plugins and chatbots on your WordPress site that are built on an open-weight model and given admin-level tools, such as editing posts, changing settings, or running commands. Third, any workflow where your team downloads a model, tests it on one machine, and deploys it on another. That gap between the test machine and the production machine is exactly where Weight2Shell hides.
How This Differs from the Poisoned AI Models and the Password Manager Breaches
Readers of this blog will remember post #22, about five poisoned AI models found on Hugging Face. That story is different from Weight2Shell, and the difference matters.
In post #22, the danger was in the files themselves. The five models contained actual malware: a Windows remote access tool in one case, and a fake system instruction in the others. Anyone who downloaded and ran those models got the malware. The files were malicious, and the fix was to check what you download and only use models from sources you trust.
Weight2Shell is subtler. The weights are identical and clean-looking. The file hash matches. There is no malware hidden in the file in the usual sense. The backdoor only appears when the same weights run on different hardware, because tiny numbers behave differently there. A file scan cannot find it, because there is nothing wrong with the file. Only a behavioral test on the deployment hardware can find it.
It is also different from post #19, about AI-assisted cyberattacks on critical infrastructure in Switzerland, where attackers used AI tools to help them break in. Weight2Shell is not about attackers using AI. It is about the AI model itself being booby-trapped before you ever download it.
And it is different from post #17 on 1Password and post #25 on pCloud Pass. Those were breaches of password manager services, where customer data was exposed. Weight2Shell is not a breach of any service, and no credentials were stolen. The fix here is about how you test models, not about changing passwords.
What to Do Now
Step 1: Only download models from sources you trust
This is the same rule as post #22, and Weight2Shell makes it more important, not less. Download open-weight models from the original publisher or a source you have a reason to trust. Be careful with re-uploaded copies, mirrors, and models from accounts with no history. If a model promises something the original does not, or the uploader cannot explain what changed, do not use it.
Step 2: Audit the model on the hardware you will deploy it on
Do not test a model on your laptop and deploy it on a cloud GPU, or test it on one cloud provider and deploy it on another, and assume the behaviour will be the same. CertiK’s recommendation is direct: audit the final checkpoint in the exact deployment environment. Run behavioral tests on the deployment stack: the same hardware, the same inference engine, the same backend, and the same number precision. Test the model with the prompts it will actually see, and watch what it does, not just what it says. A Mac-only review of a model that will run on a cloud GPU, or the other way round, can miss the hidden branch entirely.

Step 3: Give AI agents the least tool permission they need
An AI agent can only do what you allow it to do. If your coding assistant does not need shell access, do not give it shell access. If your WordPress AI plugin does not need to change settings or run commands, do not give it those tools. Keep agents away from production credentials, your hosting account, and your WordPress admin login. The Calculator demo was harmless, but the same mechanism with a different command would not be. Least privilege is the cheapest protection here.

Step 4: Check tool calls against the log
When an agent runs, compare the tool requests the model generated with what actually executed. CertiK recommends checking generated tool requests against the client’s execution log. If a model asks for a tool call you did not expect, or the log shows a command you did not approve, stop and investigate. Keep those logs. They are the record that tells you whether a model behaved differently in deployment than it did in testing.

Step 5: Repeat your tests after any change to the inference stack
A model that passed your tests can start behaving differently after a hardware change, an inference engine update, or a precision change, because those are exactly the things Weight2Shell depends on. Repeat the behavioral checks whenever you change the hardware, the engine, the backend, or the serving adapter. Do not assume a model that was safe last month is safe on new hardware.
What This Does Not Mean
This is not a reason to stop using AI. The demonstration used Calculator, a harmless app, to prove a point. No real-world Weight2Shell backdoor has been reported, and no model you downloaded has been shown to contain one. The finding is a warning about how models are audited, not a report of an attack happening now.
It is also not a reason to stop using open-weight models. Open models are useful precisely because you can inspect them, run them yourself, and test them. The lesson is to test them where they will run, with the tools they will have, instead of trusting a file hash alone.
The Bottom Line
Weight2Shell, presented by CertiK at SDC 2026 and reported on 30 November 2026, shows that identical AI model weights can behave differently on different hardware. Tiny subnormal numbers vanish on one backend and survive on another, and a supplier can train a hidden branch that stays quiet where you test it and fires where you deploy it. The file hash still matches, so a hash check cannot catch it.
So if you run open-weight models behind AI agents, test the model on the exact hardware and setup you will deploy it on, give the agent only the tool permissions it needs, and check its tool calls against the execution log. If you only use AI through a provider’s app, nothing changes for you. Either way, the rule is the same as ever: do not trust a file just because its hash matches. Test what it does, where it will run.
Need Help Locking Down Your Website?
If you want help locking down your own website and accounts, contact us or ask for a free website audit. We will check your WordPress version, plugins, and login security, and report back within 48 hours.
Related Guides
- Five Poisoned AI Models Found on Hugging Face: What to Do If You Downloaded One
- pCloud Pass Was Breached. Hackers Could Reach Encrypted Copies of Your Vault
- 1Password Was Breached. Your Passwords Are Safe, But Watch for Phishing
Leave a Reply