paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Generating realistic vulnerabilities via neural code editing: an empirical study

通过神经代码编辑生成真实漏洞:一项实证研究
FSE Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering2022匹配度 4/10 · 论文处于 ML×PL 交叉面(神经代码编辑注入漏洞、并用生成数据提升数据驱动的漏洞检测器),且属于问题驱动式实证研究(指出编辑器在真实数据集上严重失效),与用户对“ML 用于程序分析”的兴趣有交集;但它既非静态分析应用于 LLM/Agentic 程序,也未使用 LLM/Agent 改进分析,所用的三类神经代码编辑器均为非 LLM 的序列/图模型,与浮点分析、贝叶斯程序分析亦无关联,故仅边缘相关。引用 22 inbox
Yu Nong, Yuzhe Ou, Michael Pradel, Feng Chen, Haipeng Cai
crossref: 2026-09-12

AI 速览

一句话:实证研究神经代码编辑注入漏洞的可行性,揭示其潜力与差距,并证明可提升漏洞检测器F1达49.51%。

大规模真实漏洞数据集对软件安全基准测试与数据驱动方法至关重要,却严重匮乏。本文实证探索通过神经代码编辑向真实程序注入漏洞以生成此类数据集的可行性,在合成与真实数据集上评估三种最新神经代码编辑器。结果显示编辑器在真实数据上局限严重:最佳准确率仅10.03%,合成数据上为79.40%;基于图的编辑器优于序列模型,可在34.93%真实测试样本中注入漏洞,序列模型成功率为0,但仍受复杂代码结构与长编辑限制,源于预处理和深度学习模型设计不足。生成的漏洞样本可将基于深度学习的漏洞检测器F1提升至多49.51%。文末还总结编辑器擅长删除而不擅长替换等差距及改进建议。

问题
大规模真实漏洞数据集匮乏,限制了软件安全技术的基准测试与数据驱动方法发展;本文研究能否通过神经代码编辑向真实程序注入漏洞来生成此类数据集。
方法
在合成数据集与真实数据集上,系统评估三种最新神经代码编辑器执行漏洞注入的潜力与差距,并分析图/序列编辑器及预处理与深度学习模型设计的影响。
评估
以漏洞注入准确率与成功率为指标,并测试生成样本对基于深度学习的漏洞检测器F1的提升;结果显示真实数据上最佳准确率10.03%、图编辑器成功注入率最高34.93%、检测器F1最高提升49.51%。
原文摘要(Abstract)

The availability of large-scale, realistic vulnerability datasets is essential both for benchmarking existing techniques and for developing effective new data-driven approaches for software security. Yet such datasets are critically lacking. A promising solution is to generate such datasets by injecting vulnerabilities into real-world programs, which are richly available. Thus, in this paper, we explore the feasibility of vulnerability injection through neural code editing. With a synthetic dataset and a real-world one, we investigate the potential and gaps of three state-of-the-art neural code editors for vulnerability injection. We find that the studied editors have critical limitations on the real-world dataset, where the best accuracy is only 10.03%, versus 79.40% on the synthetic dataset. While the graph-based editors are more effective (successfully injecting vulnerabilities in up to 34.93% of real-world testing samples) than the sequence-based one (0 success), they still suffer from complex code structures and fall short for long edits due to their insufficient designs of the preprocessing and deep learning (DL) models. We reveal the promise of neural code editing for generating realistic vulnerable samples, as they help boost the effectiveness of DL-based vulnerability detectors by up to 49.51% in terms of F1 score. We also provide insights into the gaps in current editors (e.g., they are good at deleting but not at replacing code) and actionable suggestions for addressing them (e.g., designing effective editing primitives).

链接与引用

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

BibTeX
@inproceedings{paperbot6989,
  title = {Generating realistic vulnerabilities via neural code editing: an empirical study},
  author = {Yu Nong and Yuzhe Ou and Michael Pradel and Feng Chen and Haipeng Cai},
  booktitle = {FSE},
  year = {2022},
  doi = {10.1145/3540250.3549128}
}