Graph Is the Verifier: Agentic Reinforcement Learning for Interprocedural Vulnerability Detection
作者: Yikun Li, Ting Zhang, Jiakun Liu, Jinfeng Jiang, Yuheng Yieh, Yixin Yang, Wen Bin Leow, Yide Yin, Yintong Huo, Eng Lieh Ouh, Lwin Khin Shar, David Lo
分类: cs.CR, cs.AI, cs.SE
发布日期: 2026-07-29
💡 一句话要点
提出VulAgentRL以解决跨过程漏洞检测问题
🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture)
关键词: 跨过程漏洞检测 强化学习 代码属性图 自动化安全检测 证据验证
📋 核心要点
- 现有的漏洞检测方法往往孤立分析每个函数,导致无法准确识别跨过程漏洞。
- VulAgentRL框架通过代码属性图(CPG)实现自主证据收集与验证,提升了漏洞检测的准确性。
- 在实验中,VulAgentRL在严格的对比指标上超越了最先进的基线,并减少了工具调用次数。
📝 摘要(中文)
现实世界中的漏洞往往跨越多个函数,但大多数基于学习的检测器仅对每个函数进行孤立分类。研究发现,71.7%的漏洞函数需要外部证据才能正确分类。为此,本文提出了VulAgentRL,一个基于代码属性图(CPG)的代理强化学习框架,能够自主收集证据并进行验证。通过在训练时利用CPG进行证据验证,VulAgentRL在严格的对比指标上超越了现有的最先进基线,并在不同数据集和类别不平衡情况下保持优势。
🔬 方法详解
问题定义:本文旨在解决跨过程漏洞检测中的证据收集不足的问题。现有方法往往无法有效利用跨函数的信息,导致漏洞分类不准确。
核心思路:VulAgentRL通过引入代理强化学习框架,使模型能够自主收集和验证证据,确保检测结果的准确性。使用代码属性图(CPG)作为支持,提供了可靠的证据验证机制。
技术框架:该框架包括两个主要阶段:训练阶段和推理阶段。在训练阶段,CPG用于验证模型引用的证据;在推理阶段,模型查询CPG以获取调用者、被调用者和数据流等信息。
关键创新:VulAgentRL的创新在于使用CPG进行证据的精确验证,避免了传统方法中基于文本匹配的不足。此外,通过教师调查的蒸馏初始化,模型能够更快地学习有效的工具使用行为。
关键设计:在设计中,每个CPG节点都有一个持久的整数标识符,确保验证过程的准确性。同时,损失函数设计为奖励那些有证据支持的判决,增强了模型的学习效果。通过这种方式,VulAgentRL能够在不同数据集上保持较高的性能。
🖼️ 关键图片
📊 实验亮点
在实验中,VulAgentRL在严格的对比指标上超越了最先进的基线模型,表现出71.7%的跨过程漏洞检测准确率,同时减少了工具调用次数。这一优势在不同的数据集和类别不平衡情况下依然保持,显示出其强大的泛化能力。
🎯 应用场景
VulAgentRL的研究成果在软件安全领域具有广泛的应用潜力,尤其是在自动化漏洞检测和修复方面。该框架可以集成到现有的安全工具中,提升其检测能力,减少人工审核的工作量。未来,随着更多复杂系统的出现,VulAgentRL的技术将对提高软件安全性产生深远影响。
📄 摘要(原文)
Real-world vulnerabilities often span multiple functions, yet most learning-based detectors classify each function in isolation: on a sample of real CVEs, we find that 71.7% of vulnerable functions require evidence from outside the function to be classified correctly. Agentic reinforcement learning (RL) could close this gap by enabling a model to gather that evidence itself, but it lacks a reliable reward, since a reward defined on the final verdict alone can be obtained without performing any investigation. We propose VulAgentRL, an agentic RL framework for interprocedural vulnerability detection built on a Code Property Graph (CPG). The CPG serves two roles: at inference time the policy queries it for callers, callees, dataflow, and other queries, and at training time the same graph verifies the evidence the policy cites. Because every CPG node carries a persistent integer identifier, this verification is an exact comparison rather than a textual match, so the reward credits verdicts that are supported by evidence. We further initialize the policy by distilling teacher investigations, and show that this warm start is necessary, since RL cannot acquire tool-use behavior it never samples. Under a repository-level split that prevents leakage, VulAgentRL outperforms state-of-the-art baselines, including frontier models, on the strict pair-wise-correct metric while issuing fewer tool calls, and its advantage persists on an out-of-distribution corpus and under class imbalance.