Skip to main content
QUICK REVIEW

[论文解读] FASER: Binary Code Similarity Search through the use of Intermediate Representations

Josh Collyer, Tim Watson|arXiv (Cornell University)|Oct 5, 2023
Software Engineering ResearchComputer Science被引用 3
一句话总结

FASER 提出了一种基于中间表示(ESIL)和基于 Longformer 的 Transformer 模型的跨架构二进制函数相似性搜索方法,无需人工特征工程、预训练或动态分析。该方法在通用函数搜索和漏洞检测任务上均达到最先进性能,并在类似架构(如 MIPS 和 RISC-V)之间展现出强大的零样本迁移潜力。

ABSTRACT

Being able to identify functions of interest in cross-architecture software is useful whether you are analysing for malware, securing the software supply chain or conducting vulnerability research. Cross-Architecture Binary Code Similarity Search has been explored in numerous studies and has used a wide range of different data sources to achieve its goals. The data sources typically used draw on common structures derived from binaries such as function control flow graphs or binary level call graphs, the output of the disassembly process or the outputs of a dynamic analysis approach. One data source which has received less attention is binary intermediate representations. Binary Intermediate representations possess two interesting properties: they are cross architecture by their very nature and encode the semantics of a function explicitly to support downstream usage. Within this paper we propose Function as a String Encoded Representation (FASER) which combines long document transformers with the use of intermediate representations to create a model capable of cross architecture function search without the need for manual feature engineering, pre-training or a dynamic analysis step. We compare our approach against a series of baseline approaches for two tasks; A general function search task and a targeted vulnerability search task. Our approach demonstrates strong performance across both tasks, performing better than all baseline approaches.

研究动机与目标

  • 实现无需人工特征工程或动态分析的跨架构二进制函数相似性搜索。
  • 评估中间表示(特别是 ESIL)作为深度学习模型在二进制代码分析中输入的有效性。
  • 探究直接在二进制函数搜索目标上进行训练是否优于传统的预训练范式。
  • 评估在未见过的指令集架构之间(特别是 RISC-V)的零样本迁移性能。
  • 探索在统一中间形式下,不同指令集架构(ISA)之间的语义相似性。

提出的方法

  • 该方法使用 radare2 的可求值字符串中间语言(ESIL)作为二进制函数的跨架构、语义保持表示。
  • ESIL 字符串被分词后输入 Longformer 变压器模型,以捕捉函数表示中的长距离依赖关系。
  • 通过深度度量学习进行模型训练,以最小化三元组损失,直接优化函数相似性。
  • 训练为端到端过程,无需预训练或架构微调,仅依赖中间表示输入和度量学习目标。
  • 通过利用不同架构间 ESIL 表示中的语义相似性,支持零样本搜索。
  • 数据集从 ARM、MIPS 和 RISC-V 的二进制文件中构建,函数被提升为 ESIL 并进行归一化以用于训练。
Figure 1 : High Level Overview of Methodology
Figure 1 : High Level Overview of Methodology

实验结果

研究问题

  • RQ1像 ESIL 这样的中间表示是否能在无需人工特征工程的情况下,实现有效的跨架构二进制函数搜索?
  • RQ2在函数相似性目标上直接训练是否优于基于预训练的基线方法?
  • RQ3该模型在未见过的架构(如 RISC-V)的零样本设置下的泛化能力如何?
  • RQ4当以 ESIL 表示时,某些 ISA(如 MIPS 和 RISC-V)之间是否存在语义相似性偏差?
  • RQ5该模型是否能在无需动态分析或额外数据源的情况下,实现漏洞检测任务的强性能?

主要发现

  • FASER 在通用函数搜索和针对性漏洞检测任务上均优于所有基线方法。
  • FASER RN 模型在漏洞搜索任务中表现最佳,其性能与 GMN 相当或更优,且无需成对比较的开销。
  • RISC-V → MIPS 搜索的平均秩和中位秩显著更低(分别为 154 和 101.5),而 RISC-V → ARM 的平均秩和中位秩分别为 251 和 172,表明在 ESIL 中 MIPS 和 RISC-V 具有更强的语义相似性。
  • 在未见过的架构之间进行的零样本搜索整体表现较差,平均秩和中位秩均较高,表明对语义差异较大的 ISA 泛化能力有限。
  • 结果表明,在训练数据中包含 RISC-V 二进制文件可能有助于缓解因与 MIPS 天然语义相似性导致的数据不平衡问题。
  • 本研究证明,预训练并非强性能所必需,直接在相似性目标上进行度量学习可获得优于预训练的性能。
(a) Overview of the Model Architecture Used
(a) Overview of the Model Architecture Used

更好的研究,从现在开始

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

无需绑定信用卡

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