arXiv:2509.06052cs.SEcs.AI2025-09被引 3

用19448个二进制补丁样本测试代码大模型,发现微调后可高效识别安全补丁。

Empirical Study of Code Large Language Models for Binary Security Patch Detection

  • 构建19448个二进制补丁数据集,含汇编与伪代码两层表示
  • 微调后的代码大模型在伪代码上达到最优检测性能
  • 适用于缺乏源码的闭源系统安全补丁检测

安全补丁检测(SPD)对保障软件安全至关重要,未修复漏洞可能引发严重风险。近年来,基于学习的SPD方法在源码上表现良好,但难以应用于仅发布二进制文件的闭源软件和专有系统。尽管代码大语言模型(LLMs)在反汇编、编译优化等低级代码任务中表现优异,其在二进制补丁检测中的潜力仍待探索。为此,我们构建了一个包含19,448个样本的大规模二进制补丁数据集,提供汇编代码与伪代码两种表示形式,并系统评估了19种不同规模的代码LLM在二进制SPD任务上的能力。初步实验表明,直接提示通用代码LLM难以准确识别二进制补丁,即使先进提示技术也无法弥补模型在该任务上的领域知识缺失。基于此,我们进一步研究通过双层表示进行微调以注入领域知识。实验结果表明,微调后的模型表现优异,最佳效果出现在伪代码表示上。

原文摘要 · Abstract (English)

Security patch detection (SPD) is crucial for maintaining software security, as unpatched vulnerabilities can lead to severe security risks. In recent years, numerous learning-based SPD approaches have demonstrated promising results on source code. However, these approaches typically cannot be applied to closed-source applications and proprietary systems that constitute a significant portion of real-world software, as they release patches only with binary files, and the source code is inaccessible. Given the impressive performance of code large language models (LLMs) in code intelligence and binary analysis tasks such as decompilation and compilation optimization, their potential for detecting binary security patches remains unexplored, exposing a significant research gap between their demonstrated low-level code understanding capabilities and this critical security task. To address this gap, we construct a large-scale binary patch dataset containing \textbf{19,448} samples, with two levels of representation: assembly code and pseudo-code, and systematically evaluate \textbf{19} code LLMs of varying scales to investigate their capability in binary SPD tasks. Our initial exploration demonstrates that directly prompting vanilla code LLMs struggles to accurately identify security patches from binary patches, and even state-of-the-art prompting techniques fail to mitigate the lack of domain knowledge in binary SPD within vanilla models. Drawing on the initial findings, we further investigate the fine-tuning strategy for injecting binary SPD domain knowledge into code LLMs through two levels of representation. Experimental results demonstrate that fine-tuned LLMs achieve outstanding performance, with the best results obtained on the pseudo-code representation.

代码大模型二进制分析安全补丁微调

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。