Binary code similarity detection (BCSD) is a fundamental technique for various application. Many BCSD solutions have been proposed recently, which mostly are embedding-based, but have shown limited accuracy and efficiency especially when the volume of target binaries to search is large. To address this issue, we propose a cost-effective BCSD framework, CEBin, which fuses embedding-based and comparison-based approaches to significantly improve accuracy while minimizing overheads. Specifically, CEBin utilizes a refined embedding-based approach to extract features of target code, which efficiently narrows down the scope of candidate similar code and boosts performance. Then, it utilizes a comparison-based approach that performs a pairwise comparison on the candidates to capture more nuanced and complex relationships, which greatly improves the accuracy of similarity detection. By bridging the gap between embedding-based and comparison-based approaches, CEBin is able to provide an effective and efficient solution for detecting similar code (including vulnerable ones) in large-scale software ecosystems. Experimental results on three well-known datasets demonstrate the superiority of CEBin over existing state-of-the-art (SOTA) baselines. To further evaluate the usefulness of BCSD in real world, we construct a large-scale benchmark of vulnerability, offering the first precise evaluation scheme to assess BCSD methods for the 1-day vulnerability detection task. CEBin could identify the similar function from millions of candidate functions in just a few seconds and achieves an impressive recall rate of $85.46\%$ on this more practical but challenging task, which are several order of magnitudes faster and $4.07\times$ better than the best SOTA baseline. Our code is available at https://github.com/Hustcw/CEBin.
A Large Scale Study of AI-based Binary Function Similarity Detection Techniques for Security Researchers and Practitioners
Institute of Information Engineering, Chinese Academy of Sciences(中国科学院信息工程研究所);School of Cyber Security, University of Chinese Academy of Sciences(中国科学院大学网络安全学院);University of New South Wales(新南威尔士大学);Imperial College London(帝国理工学院);Nanyang Technological University(南洋理工大学)
Understanding Binary Code Similarity for Real-World Vulnerability Detection: A Large-Scale Empirical Study
Institute of Information Engineering, CAS(中国科学院信息工程研究所);University of Chinese Academy of Sciences(中国科学院大学);Hangzhou Dianzi University(杭州电子科技大学);Shandong University(山东大学)
Trex: Learning Execution Semantics from Micro-Traces for Binary Similarity
Columbia University(哥伦比亚大学);University of California, Riverside(加州大学河滨分校)
Detecting semantically similar functions -- a crucial analysis capability with broad real-world security usages including vulnerability detection, malware lineage, and forensics -- requires understanding function behaviors and intentions. This task is challenging as semantically similar functions can be implemented differently, run on different architectures, and compiled with diverse compiler optimizations or obfuscations. Most existing approaches match functions based on syntactic features without understanding the functions' execution semantics. We present Trex, a transfer-learning-based fr…
kTrans: Knowledge-Aware Transformer for Binary Code Embedding
Tsinghua University(清华大学);Beijing University of Technology(北京工业大学);Huazhong University of Science and Technology(华中科技大学);Information Engineering University(信息工程大学)
SimCLF: A Simple Contrastive Learning Framework for Function-level Binary Embeddings
Army Engineering University of PLA(中国人民解放军陆军工程大学);National Computer Network and Information Security Management Center(国家计算机网络与信息安全管理中心);Shanghai Jiao Tong University(上海交通大学);University Of Science & Technology Beijing(北京科技大学)