Fool Me If You Can: On the Robustness of Binary Code Similarity Detection Models against Semantics-preserving Transformations
This paper introduces asmFooler, a system that evaluates the robustness of deep learning-based binary code similarity detection models against semantics-preserving adversarial transformations, revealing that model resilience depends heavily on the processing pipeline and that well-crafted, minimal perturbations can effectively disrupt model decisions.
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 Picture: The "Look-Alike" Problem
Imagine you are a security guard at a high-tech museum. Your job is to spot forgeries. You have a super-smart AI assistant that looks at paintings and tells you if two paintings are by the same artist.
- The Good News: This AI is great at spotting the "style" of the artist, even if the paintings look slightly different.
- The Bad News: The bad guys (hackers) have figured out how to trick the AI. They can take a real painting, add a few invisible brushstrokes, or rearrange the background, and suddenly the AI thinks it's a completely different artist—or worse, it thinks a fake painting is a real masterpiece.
This paper is about testing how easily we can trick these "AI security guards" when they are looking at computer code instead of paintings.
The Characters in Our Story
The Binary Code (The Painting):
Computers don't speak English; they speak "machine code" (binary). It's a long list of instructions likemove this number hereoradd these two things. When a program is compiled, it loses all the nice names (like "calculate_tax") and becomes a raw list of numbers and commands. This is what the AI has to analyze.The BCSD Models (The AI Guards):
These are the Deep Learning models (like BinShot, Gemini, Asm2Vec) designed to compare two pieces of code and say, "Hey, these two look like they were written by the same person!" They are used to find malware, catch plagiarism, or find bugs.The Attackers (The Magicians):
The researchers in this paper acted as the attackers. They wanted to see if they could perform "magic tricks" on the code to fool the AI guards.
The Magic Tricks: How They Fooled the AI
The researchers used a system they built called asmFooler. Think of it as a magic wand that changes the code without changing what the program actually does.
They used two main types of tricks:
1. The "Cosmetic Surgery" (False Negatives)
Goal: Make two identical programs look different to the AI.
The Analogy: Imagine you have a red sports car. You want to trick a police officer into thinking it's a blue truck. You don't change the engine (the car still drives the same), but you:
- Swap the wheels.
- Rearrange the seats.
- Paint a fake stripe on the hood.
- Move the engine slightly to the left.
The Result: The car is still a red sports car, but to a quick glance, it looks totally different.
In the paper: They used techniques like Code Diversification (rearranging instructions) and Obfuscation (hiding the logic).
- Finding: Some AI guards were easily fooled. If the AI only looked at the order of the instructions, shuffling them around made the AI say, "These are totally different!" even though they were identical. However, AI guards that looked at the structure (like a map of how the code flows) were much harder to fool.
2. The "Imposter" (False Positives)
Goal: Make two different programs look identical to the AI.
The Analogy: Imagine you have a fake painting of a Van Gogh. You want the AI to think it's a real one. You can't change the whole painting, so you add a few specific brushstrokes at the very beginning that mimic Van Gogh's style perfectly.
In the paper: They used a "Greedy Sampling" strategy. They looked at a "good" piece of code, grabbed a few specific instructions from it, and pasted them into a "bad" piece of code at the very start.
- The Result: The AI got confused. It saw those few familiar instructions at the start and said, "Oh, I recognize this! It's the same as the good code!"
- The Shock: They found that they only needed to add about 15 extra instructions (a tiny amount of code) to trick the AI into thinking two completely different programs were the same.
The Key Takeaways (The "Moral of the Story")
The researchers discovered four main things:
It's All About the Pipeline:
The AI's "eyes" matter. If the AI only looks at the raw instructions (like reading a list of words), it's easy to fool. If the AI looks at the "Control Flow Graph" (like looking at a map of the road the car takes), it's much harder to trick.- Analogy: A guard who only checks the license plate is easy to fool with a fake plate. A guard who checks the engine, the VIN, and the driver's face is much harder to trick.
The "Budget" Limit:
The attackers can't change everything. They are limited by a "budget" (how many bytes they can add). If they add too much junk code, the program might break or look too suspicious. The AI's ability to handle long inputs also limits how much the attacker can do.Small Changes, Big Impact:
You don't need to rewrite the whole program to fool the AI. Just a few well-placed "magic words" (instructions) at the beginning can completely change the AI's mind.The "Copycat" Effect:
If you trick one AI model, you might accidentally trick a different AI model too, especially if they were built using similar "brains" (architectures).
Why Does This Matter?
Right now, many security companies rely on these AI models to detect malware or find code theft. This paper is a wake-up call. It says: "Hey, these AI guards are not as smart as we thought. A skilled hacker can easily walk right past them."
The authors aren't trying to break the internet; they are trying to help build better guards. By showing exactly how the AI can be fooled, they give engineers the clues they need to build stronger, more robust security systems that can't be tricked by simple magic tricks.
In short: The paper proves that while AI is great at reading code, it's currently very easy to put a disguise on that code and make the AI see something that isn't there.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.