Binary similarity models can be misled by tiny semantics-preserving code changes
Small, semantics-preserving binary transformations can cause BCSD models to produce false positives or false negatives
AI/ML arXiv 13 Feb 2026 Measurement Prototype evidence
Published as “Fool Me If You Can: On the Robustness of Binary Code Similarity Detection Models against Semantics-preserving Transformations”
Why it matters
Adversaries can reliably evade or subvert binary similarity services (e.g., ML-as-a-service detectors) with minimal code changes, highlighting the need for more robust preprocessing and training strategies.
Summary
Well-crafted semantics-preserving transformations can force false positives in binary code similarity detection models with up to 100% success while adding only 14.75 instructions on average, but robustness varies widely across models and is limited by transformation budgets and pipeline design. The authors evaluated six BCSD models on 9,565 transformed binaries derived from 620 baseline samples, showing that preprocessing, architecture, and feature selection drive resilience, yet non-deterministic variant generation and model input limits constrain attack effectiveness.
What they found 3
- FP-triggering transformations can achieve perfect attack success with minimal code overhead.
“our FP-triggering transformation reaches up to a 100% success rate while introducing only 14.75 additional instructions on average.”
- The evaluation corpus consists of 9,565 transformed binaries from 620 baseline samples.
“We construct a corpus of 9,565 variants (i.e., transformed binaries) from the 620 baseline samples”
- Four of the six models impose strict input-size limits, defining a transformation budget.
“four out of six models in our evaluation-Asm2Vec [16], SAFE [70], Trex [76], and BinShot [3], enforce such restrictions, with respective caps of 500 random walk instructions, 512 instructions, 250 tokens, and 256 tokens, respectively.”
Caveats 6
- The effectiveness of adversarial transformations is bounded by a transformation budget determined by model-specific constraints such as input size limits and the expressive capacity of equivalent instructions.
- Variant generation is non-deterministic, and the study could not exhaustively explore all possible variants, which may affect observed robustness.
- The in-place code transformation techniques ... are not formally verified. As a result, we do not guarantee full correctness across all code instances, although we partially validate that each transformation behaves as intended.
- Both inter-basic-block reordering and in-place code transformation are non-deterministic, which may impact the observed robustness of each model.
- Our evaluation does not consider advanced protections like encryption, code packing, and compression, nor commercial obfuscation tools such as Themida or VMProtect.
- A comprehensive fidelity analysis of XAI methods is beyond the scope of this study.
What’s new here 4
- Evaluates six BCSD models against eight diverse semantics-preserving binary transformations (both diversification and obfuscation).
- Introduces asmFooler, a system that generates adversarial binary variants and measures both false-negative and false-positive attack success.
- Analyzes attack transferability across models and uses SHAP and saliency to explain how perturbations disrupt model attention.
- Provides a publicly released dataset of 9,565 adversarial binary variants.