VulnLens:结构化安全解释提升 C/C++ 漏洞检测
Structured Security Explanations for Learning-Based Vulnerability Detection
论文提出 VulnLens,用 LLM 从 7 个固定视角写安全解释再训练分类器,在 PrimeVul 上 F1 超过 DeepSeek V4 Pro 和 Gemini 2.5 Pro。
arXiv 论文提出 VulnLens,一个面向 C/C++ 二进制漏洞检测的解释增强框架,把程序行为分析与最终判断分离。一个不知漏洞标签的 LLM Explainer 从数据流、内存访问、对象生命周期等 7 个固定视角生成结构化解释,再由监督训练的 Detector 通过 sequential cross-attention 融合代码与解释。在 PrimeVul 衍生的 526 函数测试集上,VulnLens 达到 75.5% 准确率和 77.2% F1,比 DeepSeek V4 Pro 高 4.2 个百分点准确率,比 Gemini 2.5 Pro 高 2.2 个点 F1。在 SecVulEval 上不重训练即取得 66.4% 准确率和 65.8% F1,F1 比 DeepSeek V4 Pro 高 20.0 个点;匹配解释使 F1 比纯代码检测器提升 7.3 个点。
Structured Security Explanations for Learning-Based Vulnerability Detection
Software vulnerability detection remains difficult because existing approaches rely on predefined analysis rules, learn vulnerability patterns implicitly from code and labels, or use large language models (LLMs) to make the final security judgment. It remains unclear whether structured descriptions of security-relevant program behavior can improve supervised detection. We present VulnLens, an explanation-augmented framework for binary C/C++ vulnerability detection that separates program-behavior analysis from the final decision. A label-blind LLM-based Explainer examines each function from seven fixed perspectives: data flow, memory access, object lifetime, arithmetic and type behavior, control flow, shared state, and external-resource access. Without receiving vulnerability labels or CWE information, it generates structured explanations. A supervised Detector combines source code and explanations through sequential cross-attention. We evaluate VulnLens on a PrimeVul-derived dataset covering ten CWE categories and test transfer to SecVulEval without retraining. On the 526-function PrimeVul test set, VulnLens achieves 75.5% accuracy and 77.2% F1, exceeding DeepSeek V4 Pro by 4.2 percentage points in accuracy and Gemini 2.5 Pro by 2.2 points in F1. Matched explanations improve F1 by 7.3 points over a separately trained code-only detector. On SecVulEval, VulnLens achieves 66.4% accuracy and 65.8% F1, outperforming DeepSeek V4 Pro by 7.6 points in accuracy and 20.0 points in F1, and Gemini 2.5 Pro by 16.6 points in accuracy and 7.8 points in F1.