Lares:LLM驱动的代码切片语义搜索用于补丁存在性测试
Lares: LLM-driven Code Slice Semantic Search for Patch Presence Testing
AI总结:
本文提出Lares方法,通过LLM驱动的代码切片语义搜索,直接从补丁源码提取特征并在目标二进制伪代码中识别语义等价切片,无需编译过程,显著提升了补丁存在性测试的可用性与准确性。
摘要:
在现代软件生态系统中,由于广泛的代码复用,1-day漏洞带来了重大的安全风险。仅识别目标二进制文件中的易受攻击函数是不够的;确定这些函数是否已被修补同样至关重要。然而,现有方法存在可用性和准确性有限的问题。它们通常依赖编译过程来提取特征,需要大量人工,且对某些软件无效。此外,它们无法可靠地区分由补丁或编译差异引起的代码更改。为了克服这些限制,我们提出了Lares,一种可扩展且准确的补丁存在性测试方法。Lares引入了代码切片语义搜索,直接从补丁源代码中提取特征,并在目标二进制文件的伪代码中识别语义等价的代码切片。通过消除对编译过程的需求,Lares提高了可用性,同时利用大语言模型(LLMs)进行代码分析和SMT求解器进行逻辑推理以增强准确性。实验结果表明,Lares实现了卓越的精确度、召回率和可用性。此外,这是首个评估跨优化级别、架构和编译器的补丁存在性测试的工作。本文使用的数据集和源代码可在 https://github.com/Siyuan-Li201/Lares 获取。
英文摘要:
In modern software ecosystems, 1-day vulnerabilities pose significant security risks due to extensive code reuse. Identifying vulnerable functions in target binaries alone is insufficient; it is also crucial to determine whether these functions have been patched. Existing methods, however, suffer from limited usability and accuracy. They often depend on the compilation process to extract features, requiring substantial manual effort and failing for certain software. Moreover, they cannot reliably differentiate between code changes caused by patches or compilation variations. To overcome these limitations, we propose Lares, a scalable and accurate method for patch presence testing. Lares introduces Code Slice Semantic Search, which directly extracts features from the patch source code and identifies semantically equivalent code slices in the pseudocode of the target binary. By eliminating the need for the compilation process, Lares improves usability, while leveraging large language models (LLMs) for code analysis and SMT solvers for logical reasoning to enhance accuracy. Experimental results show that Lares achieves superior precision, recall, and usability. Furthermore, it is the first work to evaluate patch presence testing across optimization levels, architectures, and compilers. The datasets and source code used in this article are available at https://github.com/Siyuan-Li201/Lares.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。