arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2402.18818cs.SEcs.CR
收藏

CEBin:一种用于大规模二进制代码相似性检测的高性价比框架

CEBin: A Cost-Effective Framework for Large-Scale Binary Code Similarity Detection

Hao Wang, Zeyu Gao, Chao Zhang, Mingyang Sun, Yuchen Zhou, Han Qiu, Xi Xiao

AI总结:

本文提出 CEBin 框架,融合嵌入检索与成对比较,在大规模二进制代码及 1-day 漏洞检测中显著提升速度、召回率并降低开销。

摘要:

二进制代码相似性检测(BCSD)是多种应用的一项基础技术。近年来人们提出了许多 BCSD 解决方案,其中大多数基于嵌入,但它们表现出有限的准确性和效率,尤其是在待搜索目标二进制文件数量庞大时。为解决这一问题,我们提出了一种高性价比的 BCSD 框架 CEBin,它融合了基于嵌入和基于比较的方法,在显著提升准确性的同时最大限度降低开销。具体而言,CEBin 利用一种经过改进的基于嵌入的方法提取目标代码特征,从而高效缩小候选相似代码的范围并提升性能。随后,它利用基于比较的方法对候选代码执行成对比较,以捕捉更细微、更复杂的关系,从而大幅提高相似性检测的准确性。通过弥合基于嵌入的方法与基于比较的方法之间的差距,CEBin 能够为在大规模软件生态系统中检测相似代码(包括易受攻击的代码)提供有效且高效的解决方案。在三个知名数据集上的实验结果证明了 CEBin 相对于现有最先进(SOTA)基线的优越性。为进一步评估 BCSD 在真实世界中的实用性,我们构建了一个大规模漏洞基准,提供了首个精确评估方案,用于在 1-day 漏洞检测任务中评估 BCSD 方法。CEBin 仅需数秒即可从数百万个候选函数中识别出相似函数,并在这一更实际但更具挑战性的任务上取得了令人瞩目的 85.46% 召回率;其速度快了数个数量级,且效果比最佳 SOTA 基线好 4.07 倍。我们的代码可在 https://github.com/Hustcw/CEBin 获取。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑