TL;DR
This paper tackles the challenges in Binary Code Similarity Analysis (BCSA) by introducing a comprehensive, reproducible benchmark (BINKIT) and an interpretable analysis tool (TIKNIB). They demonstrate that carefully engineered, elementary presemantic features can achieve state-of-the-art accuracy, challenging the reliance on complex, uninterpretable deep learning models and highlighting the impact of compilation choices.
What Problem Does This Paper Address?
Binary Code Similarity Analysis (BCSA) is crucial for security applications like plagiarism detection and vulnerability discovery. However, the field faces several hurdles:
- Lack of Reproducibility: Researchers often use proprietary benchmarks, making it difficult to compare methods or reproduce results.
- Uninterpretable Models: Many approaches rely on complex machine learning models that offer little insight into why they work, hindering deeper understanding and debugging.
- Inconsistent Terminology and Benchmarks: A lack of standardization in features, terminology, and evaluation datasets makes it hard to build upon previous work.
- Over-reliance on Semantic Features: The prevailing assumption is that semantic features are essential for cross-architecture and cross-compiler analysis, often overshadowing the potential of simpler presemantic features.
This paper aims to address these issues by providing a standardized, reproducible benchmark and an interpretable analysis framework to systematically re-evaluate existing BCSA techniques and uncover fundamental insights.
Methods
The authors introduce a novel approach centered around interpretable feature engineering and a reproducible benchmark.
- BINKIT Benchmark: This is a large-scale, reproducible benchmark comprising 243,128 binaries compiled from 51 real-world software packages. It covers 8 architectures, 9 compiler versions, 5 optimization levels, and includes options like PIE, LTO, and obfuscation. Crucially, it comes with automated scripts for building and extending, addressing the reproducibility issue.
- TIKNIB Tool: This tool employs a simple, interpretable BCSA model. Instead of complex deep learning, TIKNIB uses a set of presemantic features (e.g., control flow graph (CFG) and call graph (CG) metrics) and a straightforward scoring metric based on the relative difference between feature values. This interpretability allows for a deeper understanding of feature effectiveness and failure cases.
- Feature Engineering: The paper focuses on selecting and evaluating a set of numeric presemantic features, including basic block counts, edge counts, loop counts, and call graph metrics. They also explore the impact of type information extracted from debugging symbols.
- Experimental Design: They employ a rigorous 10-fold cross-validation approach and a feature selection method based on ROC AUC to identify the most discriminative features.
Datasets
- BINKIT: The primary contribution is the creation of this new, large-scale, reproducible benchmark. It contains 243,128 binaries and 36,256,322 functions, compiled from 51 software packages across various architectures, compilers, and optimization levels. BINKIT is publicly available.
- ASE Datasets: For comparison with state-of-the-art tools like VulSeeker, the authors used existing datasets (ASE1-ASE4) that were originally used in prior BCSA research. These datasets are also described and used to validate TIKNIB's performance.
- Firmware Dataset (FirmAE): To evaluate TIKNIB on real-world IoT devices, they utilized the FirmAE dataset, comprising 1,124 firmware images.
Key Insights and Ideas
- Presemantic Features Can Be Powerful: The study strongly suggests that carefully engineered presemantic features, when analyzed with an interpretable model, can achieve accuracy comparable to or even exceeding complex deep learning models that rely on semantic features. This challenges the prevailing notion that semantic analysis is always necessary for robust BCSA.
- Compilation Choices Matter More Than Architecture: Surprisingly, the authors found that optimization levels and compiler choices have a more significant impact on binary similarity than the target architecture itself. This implies that understanding compilation settings is crucial for accurate BCSA.
- Interpretability is Key to Understanding: By using an interpretable model (TIKNIB), the authors could pinpoint issues with binary analysis tools (like IDA Pro) and understand why certain features are robust or not across different compilation settings. This is a significant advantage over black-box models.
- Type Information is Highly Beneficial: Extracting type information from debugging symbols, even basic types, significantly boosts BCSA accuracy, demonstrating the value of leveraging available debugging information.
- Failure Case Analysis Drives Improvement: Analyzing failure cases with an interpretable model revealed common issues like errors in binary analysis tools and significant differences between compiler back-ends, providing concrete directions for future research.
Key Results
- High Accuracy with Simple Features: TIKNIB, using only presemantic features and a simple linear model, achieved accuracy comparable to state-of-the-art tools like VulSeeker on various benchmarks. For instance, on the ASE datasets, TIKNIB achieved AUCs around 0.97-0.99, often outperforming VulSeeker on specific folds.
- Type Information Boosts Accuracy: Incorporating type information led to AUC and Average Precision (AP) values exceeding 0.99 across all tests, a significant improvement over models without it.
- Vulnerability Detection Success: In a case study on the Heartbleed vulnerability, TIKNIB successfully identified the vulnerable function with a rank close to 1.0 and precision@1 close to 1.0 in most tests, demonstrating its practical applicability.
- IoT Firmware Analysis: TIKNIB also showed comparable performance to existing tools on identifying vulnerabilities in IoT firmware images, highlighting its robustness across different domains.
- Optimization Impact: The study quantified the impact of optimization levels, showing that differences between O0 and O3 could be more significant than architectural differences.
Limitations and Future Work
- Scope: The current study focuses on function-level similarity. The authors suggest extending this to whole-binary-level analysis.
- Compiler-Specific Functions: While efforts were made to exclude compiler-generated functions, their potential inlining into caller functions might still affect results.
- MIPS Binary Analysis: The authors note potential inaccuracies in analyzing MIPS binaries, suggesting further investigation.
- Feature Set: While TIKNIB uses established presemantic features, exploring more advanced NLP techniques for feature representation is suggested.
- Semantic Features: The effectiveness of semantic features remains less explored and is an area for future research.
- Decompilation: The paper highlights the potential of decompilation techniques for BCSA, an area ripe for further investigation.
- Targeted Models: Training models for specific compiler option sets could enhance BCSA techniques.
Summary updated