Understanding Binary Code Similarity for Real-World Vulnerability Detection: A Large-Scale Empirical Study
Open Access
- 30 June 2026
- journal article
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 3 (FSE) , 657-677
Abstract
Firmware lies at the heart of IoT devices. Its development depends heavily on third-party libraries (TPLs), which greatly accelerate the process but simultaneously introduce associated vulnerabilities. Binary Code Similarity Detection (BCSD) is an effective technique for identifying vulnerabilities in firmware by comparing pairs of code segments. However, existing studies either evaluate their performance only on small-scale datasets or lack diversity in terms of vulnerabilities, TPLs, and firmware. Consequently, a comprehensive understanding of BCSD for real-world vulnerability detection remains absent. To bridge this gap, we conduct a large-scale study of vulnerability detection across 60,000 firmware images from 200 vendors using BCSD. Rather than introducing a novel model, we examine the influence of four key factors—vulnerable function versions, vulnerability search space, function sizes, and compilation toolchains on BCSD performance. Our results reveal that these factors substantially affect performance, often by wide margins. To address this, we propose a build-aware query strategy that derives queries from representative real-world binaries, effectively closing the gap and raising the mean reciprocal rank (MRR) from 0.818 to 0.981. Furthermore, we demonstrate that a TPL-aware, two-stage search process significantly enhances accuracy, improving MRR by 18.5% by limiting the search space.Keywords
All Related Versions
This publication has 28 references indexed in Scilit:
- A Survey on Intelligent Internet of Things: Applications, Security, Privacy, and Future DirectionsIEEE Communications Surveys & Tutorials, 2024
- Revisiting Binary Code Similarity Analysis Using Interpretable Feature Engineering and Lessons LearnedIEEE Transactions on Software Engineering, 2022
- Asteria: Deep Learning-based AST-Encoding for Cross-platform Binary Code Similarity Detection2021
- Karonte: Detecting Insecure Multi-binary Interactions in Embedded Firmware2020
- SAFE: Self-Attentive Function Embeddings for Binary Similarity2019
- Asm2Vec: Boosting Static Representation Robustness for Binary Clone Search against Code Obfuscation and Compiler Optimization2019
- Anti-Crawler strategy and distributed crawler based on Hadoop2018
- Scalable Graph-based Bug Search for Firmware Images2016
- Automated Dynamic Firmware Analysis at Scale2016
- Tracelet-based code search in executables2014