arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2401.11161cs.SE
收藏

BinaryAI:通过智能二进制源代码匹配进行二进制软件成分分析

BinaryAI: Binary Software Composition Analysis via Intelligent Binary Source Code Matching

Ling Jiang, Junwen An, Huihui Huang, Qiyi Tang, Sen Nie, Shi Wu, Yuqun Zhang

AI总结:

提出BinaryAI,一种通过两阶段二进制源代码匹配捕获语法和语义特征的新型二进制到源码SCA技术,显著提升了函数匹配和TPL检测的精确率与召回率。

摘要:

尽管在软件开发过程中广泛复用第三方库(TPL)以提高生产力,但它们也可能引入潜在的安全风险,如漏洞传播。软件成分分析(SCA)旨在识别复用的TPL以降低此类风险,已成为现代DevSecOps中的关键环节。作为主流SCA技术之一,二进制到源码的SCA通过二进制源代码匹配来识别二进制文件中包含的第三方源码项目。由于二进制和源码在编译后存在巨大差异,这是逆向工程中的一大挑战。现有的二进制到源码SCA技术利用基本的语法特征,存在冗余问题且在大规模TPL数据集上缺乏鲁棒性,导致不可避免的误报和受损的召回率。为缓解这些限制,我们提出了BinaryAI,一种采用两阶段二进制源代码匹配的新型二进制到源码SCA技术,以捕获语法和语义代码特征。首先,BinaryAI训练一个基于transformer的模型来生成函数级嵌入,并据此为每个二进制函数获取相似的源码函数。然后,通过应用链接时局部性来促进函数匹配,BinaryAI基于匹配的源码函数比例检测复用的TPL。实验结果证明BinaryAI在二进制源代码匹配和下游SCA任务中表现卓越。具体而言,我们的嵌入模型优于最先进的模型CodeCMR,即与10.75%和0.17相比,分别实现了22.54%的recall@1和0.34的MRR。此外,在TPL检测方面,BinaryAI优于所有现有的二进制到源码SCA工具,与广受认可的商业SCA产品相比,精确率从73.36%提升至85.84%,召回率从59.81%提升至64.98%。

英文摘要:

While third-party libraries are extensively reused to enhance productivity during software development, they can also introduce potential security risks such as vulnerability propagation. Software composition analysis, proposed to identify reused TPLs for reducing such risks, has become an essential procedure within modern DevSecOps. As one of the mainstream SCA techniques, binary-to-source SCA identifies the third-party source projects contained in binary files via binary source code matching, which is a major challenge in reverse engineering since binary and source code exhibit substantial disparities after compilation. The existing binary-to-source SCA techniques leverage basic syntactic features that suffer from redundancy and lack robustness in the large-scale TPL dataset, leading to inevitable false positives and compromised recall. To mitigate these limitations, we introduce BinaryAI, a novel binary-to-source SCA technique with two-phase binary source code matching to capture both syntactic and semantic code features. First, BinaryAI trains a transformer-based model to produce function-level embeddings and obtain similar source functions for each binary function accordingly. Then by applying the link-time locality to facilitate function matching, BinaryAI detects the reused TPLs based on the ratio of matched source functions. Our experimental results demonstrate the superior performance of BinaryAI in terms of binary source code matching and the downstream SCA task. Specifically, our embedding model outperforms the state-of-the-art model CodeCMR, i.e., achieving 22.54% recall@1 and 0.34 MRR compared with 10.75% and 0.17 respectively. Additionally, BinaryAI outperforms all existing binary-to-source SCA tools in TPL detection, increasing the precision from 73.36% to 85.84% and recall from 59.81% to 64.98% compared with the well-recognized commercial SCA product.

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

↑