arXiv:2602.12500cs.SEcs.AI2026-02

用智能代理精准定位漏洞修复代码,提升安全维护效率

Favia: Forensic Agent for Vulnerability-fix Identification and Analysis

  • 采用分阶段智能代理框架,先筛选候选再深度推理
  • 在800万+提交数据上实现最高F1分数,超越现有方法
  • 适合安全研究者和开源维护团队快速定位复杂修复

识别与已披露漏洞(CVE)对应的修复提交对保障软件安全至关重要,但在大规模仓库中仍具挑战性,因数百万提交中仅有少量涉及安全问题。现有自动化方法(包括传统机器学习与基于大语言模型的方法)常面临精确率-召回率权衡不佳的问题。我们在真实场景下发现,现有评估常低估难度——候选提交本身已高度相关且相似。为此,我们提出Favia,一种基于智能体的取证框架,结合高效候选排序与深度迭代语义推理。首先通过快速排序缩小搜索范围,随后利用基于ReAct的LLM智能体,在预提交仓库环境下,借助专用工具定位漏洞组件、导航代码库,并建立代码变更与漏洞根因间的因果关联。该证据驱动流程可有效识别间接、跨文件及非显式修复,突破单次扫描或相似性方法的局限。我们在自建的大规模数据集CVEVC上评估,该数据集包含3,708个真实仓库中的超800万条提交,结果表明,Favia在真实候选选择条件下持续优于顶尖传统与基于大模型的基线,实现了最佳精确率-召回率平衡与最高F1值。

原文摘要 · Abstract (English)

Identifying vulnerability-fixing commits corresponding to disclosed CVEs is essential for secure software maintenance but remains challenging at scale, as large repositories contain millions of commits of which only a small fraction address security issues. Existing automated approaches, including traditional machine learning techniques and recent large language model (LLM)-based methods, often suffer from poor precision-recall trade-offs. Frequently evaluated on randomly sampled commits, we uncover that they are substantially underestimating real-world difficulty, where candidate commits are already security-relevant and highly similar. We propose Favia, a forensic, agent-based framework for vulnerability-fix identification that combines scalable candidate ranking with deep and iterative semantic reasoning. Favia first employs an efficient ranking stage to narrow the search space of commits. Each commit is then rigorously evaluated using a ReAct-based LLM agent. By providing the agent with a pre-commit repository as environment, along with specialized tools, the agent tries to localize vulnerable components, navigates the codebase, and establishes causal alignment between code changes and vulnerability root causes. This evidence-driven process enables robust identification of indirect, multi-file, and non-trivial fixes that elude single-pass or similarity-based methods. We evaluate Favia on CVEVC, a large-scale dataset we made that comprises over 8 million commits from 3,708 real-world repositories, and show that it consistently outperforms state-of-the-art traditional and LLM-based baselines under realistic candidate selection, achieving the strongest precision-recall trade-offs and highest F1-scores.

漏洞检测智能代理代码分析安全维护

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