Poisoned Identifiers Survive LLM Deobfuscation: A Case Study on Claude Opus 4.6
This study demonstrates that Claude Opus 4.6 frequently retains poisoned identifier names from obfuscated JavaScript even when it correctly understands and comments on the code's semantics, though this persistence can be significantly reduced by reframing the task from deobfuscation to fresh implementation.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
The Big Idea: The "Ghost in the Machine"
Imagine you hire a brilliant translator to translate a secret, scrambled book back into English. The book contains a hidden trick: the author has replaced all the real words with fake, misleading words (like calling a "brake" a "gas pedal").
You tell the translator: "Please decode this, but make sure you check the meaning. If the word says 'gas pedal' but the picture shows a car stopping, write 'brake' instead."
The Shocking Result: The translator reads the book, understands perfectly that the car is stopping, and even writes a note in the margin saying, "This is clearly a brake." But, when they write the final sentence, they still use the fake word: "Press the gas pedal to stop."
This paper proves that even the smartest AI (Claude Opus 4.6) will often keep "poisoned" names in the code it writes, even when it knows those names are wrong.
The Experiment: Two Ways to Ask
The researchers tested this on two types of computer programs:
- A Physics Simulation: A program that simulates how particles attract and repel each other (like magnets).
- A Pathfinding Algorithm: A program that finds the shortest route through a maze.
They scrambled the code (obfuscated it) and replaced the real variable names with "poisoned" ones. For example, they renamed repulsion (pushing away) to attraction (pulling together).
They tried two different ways to ask the AI to fix it:
1. The "Translator" Approach (Deobfuscate)
The Prompt: "Here is scrambled code. Please decode it and write it back clearly."
The Result: The AI acted like a strict translator. It saw the scrambled list of names (the "string table") and just copied them over, even though they were wrong.
- Success Rate of Poison: 100%. The AI kept the wrong names.
- The Weird Part: The AI wrote comments saying, "This variable controls repulsion," but the code itself still said
attraction. It was like a person saying, "I am eating a sandwich," while holding a picture of a pizza.
2. The "Architect" Approach (Rewrite from Scratch)
The Prompt: "Don't just decode this. Ignore the original names. Write a brand new program from scratch that does the same thing."
The Result: The AI stopped acting like a translator and started acting like a builder. It looked at what the code actually did and gave the variables the correct names.
- Success Rate of Poison: Dropped to 0% or 20%. The AI fixed the names!
The Lesson: Telling the AI to "check its work" didn't help. But changing the job description from "translator" to "builder" fixed the problem.
The "Zero-Fit" Surprise
The researchers thought maybe the AI kept the wrong names because the fake names sounded plausible (e.g., calling a "brake" a "clutch" sounds like a car part).
So, they tried something silly. They replaced the names with words that made zero sense in the context.
- Instead of
repulsion, they usedcombustion. - Instead of
heuristic(a math term), they usedinvoice.
The Result: The AI still kept the wrong names 100% of the time!
- Why? The researchers believe the AI looks at the whole list of names. If the list looks like a coherent "domain" (e.g., all car parts), the AI trusts it. If the list is a mess of random words, the AI gets confused and just defaults to keeping the original "source" names because it doesn't have a better alternative to swap them with.
Why Does This Matter? (The "Cost Multiplier")
The paper concludes that this isn't a way to hide code forever (a hacker can still read it manually). Instead, it's a way to make the AI's life expensive and annoying.
- The Analogy: Imagine a security guard (the AI) checking a building.
- Normal Code: The guard walks in, sees the signs, and says, "All clear." (Fast, cheap).
- Poisoned Code: The guard walks in, sees the signs say "Exit" but the door is a wall. The guard writes a report saying, "This is an exit," but still writes "Exit" on the map. Now, a human has to spend 3 hours re-checking the map to fix the AI's mistakes.
The Takeaway:
- Don't trust the AI to "verify" itself. If you tell it "check your work," it will still copy the poison.
- Change the task. If you want clean code, tell the AI to "build a new one from scratch" rather than "fix this old one."
- The "Dual Representation" Bug: The AI is smart enough to know the truth (in the comments) but stubborn enough to keep the lie (in the code).
Summary in One Sentence
Even the smartest AI will copy "poisoned" names from scrambled code if you ask it to translate, but it will fix them if you ask it to build something new, proving that how you ask the question matters more than how hard you tell it to be careful.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.