[Paper Review] Asteria-Pro: Enhancing Deep-Learning Based Binary Code Similarity Detection by Incorporating Domain Knowledge
Asteria-Pro enhances deep-learning-based binary code similarity detection by integrating domain knowledge through pre-filtration and re-ranking modules, reducing computation time by 96.9% and improving MRR and Recall by 23.71% and 36.4%, respectively, achieving 91.65% precision in detecting 1,482 vulnerable functions in real-world firmware.
The widespread code reuse allows vulnerabilities to proliferate among a vast variety of firmware. There is an urgent need to detect these vulnerable code effectively and efficiently. By measuring code similarities, AI-based binary code similarity detection is applied to detecting vulnerable code at scale. Existing studies have proposed various function features to capture the commonality for similarity detection. Nevertheless, the significant code syntactic variability induced by the diversity of IoT hardware architectures diminishes the accuracy of binary code similarity detection. In our earlier study and the tool Asteria, we adopt a Tree-LSTM network to summarize function semantics as function commonality and the evaluation result indicates an advanced performance. However, it still has utility concerns due to excessive time costs and inadequate precision while searching for large-scale firmware bugs. To this end, we propose a novel deep learning enhancement architecture by incorporating domain knowledge-based pre-filtration and re-ranking modules, and we develop a prototype based on Asteria called Asteria-Pro. Pre-filtration module seeks to eliminates dissimilar functions to boost subsequent deep learning model calculations, while re-ranking module aims to raises the rankings of vulnerable functions among candidates generated by deep learning model. Our evaluation indicates that pre-filtration module cuts the calculation time by 96.9% and re-ranking improves MRR and Recall by 23.71% and 36.4%. By incorporating the pre-filtration and re-ranking modules, Asteria-Pro outperforms existing state-of-the-art approaches in bug search task, by a significant large margin. We conduct a large-scale real-world firmware bug search and Asteria-Pro manages to detect 1,482 vulnerable functions with a high precision 91.65%.
Motivation & Objective
- Address the challenge of low accuracy and high computational cost in deep-learning-based binary code similarity detection (BCSD) for IoT firmware due to architectural diversity and syntactic variability.
- Overcome limitations of existing BCSD tools that rely heavily on emulation or symbolic execution, which are infeasible for large-scale firmware analysis.
- Improve the scalability and precision of vulnerability detection in real-world firmware by incorporating domain-specific knowledge into the deep learning pipeline.
- Enable efficient and accurate detection of homologous vulnerable functions across diverse IoT hardware architectures without requiring source code or function names.
Proposed method
- Introduce a pre-filtration module that leverages function name heuristics and domain-specific rules to eliminate dissimilar functions before deep learning encoding, drastically reducing the number of candidates.
- Apply a Tree-LSTM-based deep learning model to encode function semantics into dense embeddings, capturing functional commonality independent of instruction set architecture.
- Design a re-ranking module that uses the function call structure and control flow patterns to recalibrate similarity scores from the deep learning model, elevating true positives.
- Integrate the pre-filtration and re-ranking modules into a unified pipeline that enhances both efficiency and precision of the BCSD process.
- Leverage abstract syntax trees (ASTs) derived from lifted intermediate representations to extract architecture-independent semantic features for model input.
- Use graph neural networks (GNNs) to model control and data dependencies in binary functions, improving semantic representation beyond simple sequence-based models.
Experimental results
Research questions
- RQ1Can domain knowledge-based pre-filtration significantly reduce the computational cost of deep learning-based binary code similarity detection in large-scale firmware analysis?
- RQ2To what extent can a post-processing re-ranking module based on function call structure improve the precision of vulnerability detection by re-scoring similarity scores?
- RQ3How does Asteria-Pro compare to state-of-the-art BCSD tools in terms of accuracy, speed, and scalability when detecting N-day vulnerabilities in real-world firmware?
- RQ4Can the integration of pre-filtration and re-ranking modules be generalized to enhance other embedding-based BCSD methods beyond Asteria-Pro?
Key findings
- The pre-filtration module reduces the total computation time for similarity detection by 96.9% by eliminating 96.9% of non-similar function pairs before deep learning inference.
- The re-ranking module improves Mean Reciprocal Rank (MRR) by 23.71% and Recall by 36.4% compared to the baseline deep learning model alone.
- In a large-scale real-world firmware analysis, Asteria-Pro successfully detected 1,482 vulnerable functions with a high precision of 91.65%.
- The tool identified inlined vulnerable code in CVE-2017-13001, demonstrating its ability to detect complex, obfuscated vulnerabilities across diverse firmware binaries.
- Embedding the pre-filtration and re-ranking modules into other baseline embedding methods significantly improves their precision, indicating broad applicability.
- Asteria-Pro outperforms existing state-of-the-art BCSD approaches in both speed and accuracy, particularly in cross-architecture vulnerability detection.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.