Skip to main content
QUICK REVIEW

[论文解读] UniASM: Binary Code Similarity Detection without Fine-tuning

Yeming Gu, Hui‐Kuo G. Shu|arXiv (Cornell University)|Oct 28, 2022
Software Engineering Research被引用 6
一句话总结

UniASM 提出了一种基于 UniLM 的新型二进制代码嵌入模型,在无需微调的情况下实现了二进制代码相似性检测的最先进性能。它引入了丰富的语义函数表示和两项新的预训练任务,分别在跨编译器、跨优化和跨混淆基准上将 Recall@1 提升了 12.7%、8.5% 和 22.3%。

ABSTRACT

Binary code similarity detection (BCSD) is widely used in various binary analysis tasks such as vulnerability search, malware detection, clone detection, and patch analysis. Recent studies have shown that the learning-based binary code embedding models perform better than the traditional feature-based approaches. However, previous studies have not delved deeply into the key factors that affect model performance. In this paper, we design extensive ablation studies to explore these influencing factors. The experimental results have provided us with many new insights. We have made innovations in both code representation and model selection: we propose a novel rich-semantic function representation technique to ensure the model captures the intricate nuances of binary code, and we introduce the first UniLM-based binary code embedding model, named UniASM, which includes two newly designed training tasks to learn representations of binary functions. The experimental results show that UniASM outperforms the state-of-the-art (SOTA) approaches on the evaluation datasets. The average scores of Recall@1 on cross-compilers, cross-optimization-levels, and cross-obfuscations have improved by 12.7%, 8.5%, and 22.3%, respectively, compared to the best of the baseline methods. Besides, in the real-world task of known vulnerability search, UniASM outperforms all the current baselines.

研究动机与目标

  • 通过广泛的消融研究,探究影响二进制代码嵌入模型性能的关键因素。
  • 开发一种鲁棒的、零样本能力的二进制代码相似性检测模型,使其能泛化于各种二进制变体。
  • 设计一种函数表示技术,以捕捉二进制代码中复杂的语义细微差别。
  • 提出一种基于 UniLM 的架构,并引入新颖的预训练任务,以提升二进制函数嵌入效果。
  • 在无需微调的情况下,超越现有最先进方法在跨编译器、跨优化和混淆场景下的表现。

提出的方法

  • 提出一种丰富的语义函数表示技术,用于编码来自二进制函数的详细低级语义信息。
  • 引入一种基于 UniLM 的架构(UniASM),用于学习二进制函数的上下文嵌入表示。
  • 设计两项新的预训练任务——掩码函数建模和下个函数预测,以增强表示学习能力。
  • 在大规模二进制代码语料上训练模型,而无需在下游任务上进行任何微调。
  • 采用自监督学习方法,捕捉多样化二进制代码中的结构与语义模式。
  • 采用双分支对比学习设置,对齐语义相似的函数,同时分离语义不同的函数。

实验结果

研究问题

  • RQ1影响二进制代码嵌入模型性能的关键因素是什么?
  • RQ2统一语言模型架构能否在无需特定任务微调的情况下,有效学习二进制函数的表示?
  • RQ3丰富的语义函数表示如何提升二进制代码中的相似性检测效果?
  • RQ4预训练的基于 UniLM 的模型在跨编译器、跨优化和混淆场景下的泛化能力达到何种程度?
  • RQ5所提出的模型能否在真实世界漏洞搜索任务中超越现有最先进方法?

主要发现

  • 与最佳基线相比,UniASM 在跨编译器二进制相似性检测任务中,Recall@1 提升了 12.7%。
  • 在跨优化级别检测中,Recall@1 提升了 8.5%,表明其对编译器优化具有强鲁棒性。
  • 在跨混淆场景中,UniASM 在 Recall@1 上实现了 22.3% 的相对提升,表明其对代码变换具有强大抗性。
  • 在真实世界已知漏洞搜索任务中,UniASM 超越了所有现有基线,证实了其实际应用价值。
  • 消融研究证实,丰富的语义表示以及两项新的预训练任务均对性能提升有显著贡献。
  • 该模型在无需任何微调的情况下达到最先进结果,凸显其强大的零样本泛化能力。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。