paperbot · PL 论文追踪

全部论文 待读 收藏

P2 How Effective Are Neural Networks for Fixing Security Vulnerabilities

神经网络修复安全漏洞的效果如何?
ISSTA Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis2023匹配度 3/10 · 该论文聚焦 LLM 与深度学习 APR 模型修复 Java 安全漏洞的能力对比,属于「LLM 用于软件工程/程序修复」方向,与用户画像中的静态分析×LLM、浮点程序分析、贝叶斯程序分析三条主线均无直接交集;且实验主要基于 Codex/CodeGen 等较旧模型,与「偏好建立在当前较强模型之上」的取向不符。仅其新基准 VJBench 的构建及对失效 CWE 类型的成因分析,在「缺乏 benchmark 的场景」这一偏好上有一定参考价值。引用 175 inbox
Yi Wu, Nan Jiang, Hung Viet Pham, Thibaud Lutellier, Jordan Davis, Lin Tan, Petr Babkin, Sameena Shah
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:首次系统比较 LLM 与深度学习自动程序修复模型修复 Java 安全漏洞的能力,并构建新基准 VJBench。

安全漏洞修复亟需自动化,大代码语言模型(LLM)与基于深度学习的自动程序修复(APR)技术都显示出潜力,但二者在漏洞修复上的能力尚未被系统比较。本文首次针对 Java 漏洞修复开展对比研究:在 Vul4J 与 VJBench 两个真实 Java 漏洞基准上评估了 5 个 LLM(Codex、CodeGen、CodeT5、PLBART、InCoder)、4 个微调 LLM 以及 4 种 DL-based APR 技术;为缓解 Codex 训练与测试数据重叠的威胁,设计了代码变换;并创建新基准 VJBench 及其变换版本 VJBench-trans。结果显示,现有 LLM 与 APR 模型只能修复极少数 Java 漏洞,Codex 修复最多(10.2 个,20.4%),且大量生成补丁无法编译;用通用 APR 数据微调可提升 LLM 的漏洞修复能力;VJBench 揭示模型难以修复 CWE-325、CWE-444 等类型;在变换漏洞上 Codex 仍修复 8.7 个,优于其他所有模型。作者据此呼吁构建更大规模的漏洞修复训练数据、用其微调 LLM,并引入代码简化变换以促进漏洞修复。

问题
Java 安全漏洞修复困难且缺乏自动化,已有的大代码语言模型与基于深度学习的自动程序修复技术各具潜力,但尚不清楚它们在真实 Java 漏洞修复上的实际效果与局限。
方法
在 Vul4J 与新建的 VJBench 基准上,对 5 个 LLM、4 个微调 LLM 和 4 种 DL-based APR 技术进行对比评估,并设计代码变换以缓解 Codex 的训练/测试数据重叠,同时构造变换版本 VJBench-trans 检验模型在变换漏洞上的表现。
评估
以修复漏洞数量和补丁可编译性等为指标,在两个真实 Java 漏洞基准及其变换版本上比较各 LLM 与 APR 技术,并按 CWE 类型分析失败情况。
原文摘要(Abstract)

Security vulnerability repair is a difficult task that is in dire need of automation. Two groups of techniques have shown promise: (1) large code language models (LLMs) that have been pre-trained on source code for tasks such as code completion, and (2) automated program repair (APR) techniques that use deep learning (DL) models to automatically fix software bugs. This paper is the first to study and compare Java vulnerability repair capabilities of LLMs and DL-based APR models. The contributions include that we (1) apply and evaluate five LLMs (Codex, CodeGen, CodeT5, PLBART and InCoder), four fine-tuned LLMs, and four DL-based APR techniques on two real-world Java vulnerability benchmarks (Vul4J and VJBench), (2) design code transformations to address the training and test data overlapping threat to Codex, (3) create a new Java vulnerability repair benchmark VJBench, and its transformed version VJBench-trans, to better evaluate LLMs and APR techniques, and (4) evaluate LLMs and APR techniques on the transformed vulnerabilities in VJBench-trans. Our findings include that (1) existing LLMs and APR models fix very few Java vulnerabilities. Codex fixes 10.2 (20.4%), the most number of vulnerabilities. Many of the generated patches are uncompilable patches. (2) Fine-tuning with general APR data improves LLMs’ vulnerability-fixing capabilities. (3) Our new VJBench reveals that LLMs and APR models fail to fix many Common Weakness Enumeration (CWE) types, such as CWE-325 Missing cryptographic step and CWE-444 HTTP request smuggling. (4) Codex still fixes 8.7 transformed vulnerabilities, outperforming all the other LLMs and APR models on transformed vulnerabilities. The results call for innovations to enhance automated Java vulnerability repair such as creating larger vulnerability repair training data, tuning LLMs with such data, and applying code simplification transformation to facilitate vulnerability repair.

链接与引用

DOI 原文 · arXiv · PDF(开放获取) · DBLP

BibTeX
@inproceedings{WuJPLD0BS23,
  title = {How Effective Are Neural Networks for Fixing Security Vulnerabilities},
  author = {Yi Wu and Nan Jiang and Hung Viet Pham and Thibaud Lutellier and Jordan Davis and Lin Tan and Petr Babkin and Sameena Shah},
  booktitle = {ISSTA},
  year = {2023},
  doi = {10.1145/3597926.3598135}
}