arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.05868cs.CR
收藏

持久的人类反馈、LLMs和静态分析器用于安全代码生成和漏洞检测

Persistent Human Feedback, LLMs, and Static Analyzers for Secure Code Generation and Vulnerability Detection

Technische Universität Clausthal(不伦瑞克工业大学)

Ehsan Firouzi, Mohammad Ghafari

AI总结:

本文提出了一种持久存储人类反馈的框架,以提升LLMs在安全代码生成和漏洞检测中的可靠性。

摘要:

现有文献严重依赖静态分析工具来评估LLMs在安全代码生成和漏洞检测中的表现。我们回顾了1,080个LLM生成的代码样本,构建了经过人类验证的ground-truth,并将两种广泛使用的静态安全工具CodeQL和Semgrep的输出与该语料库进行比较。虽然61%的样本实际上是安全的,但Semgrep和CodeQL分别将60%和80%的样本分类为安全。尽管在总体统计数据上似乎有共识,但逐样本分析显示存在显著差异:只有Semgrep的65%和CodeQL的61%的报告与ground-truth匹配。这些结果质疑了静态分析工具作为代码安全评估唯一评估者的可靠性,并强调了专家反馈的必要性。基于这一见解,我们提出了一种概念框架,该框架在动态检索增强生成管道中持久存储人类反馈,使LLMs能够重用过去的反馈进行安全代码生成和漏洞检测。

英文摘要:

Existing literature heavily relies on static analysis tools to evaluate LLMs for secure code generation and vulnerability detection. We reviewed 1,080 LLM-generated code samples, built a human-validated ground-truth, and compared the outputs of two widely used static security tools, CodeQL and Semgrep, against this corpus. While 61% of the samples were genuinely secure, Semgrep and CodeQL classified 60% and 80% as secure, respectively. Despite the apparent agreement in aggregate statistics, per-sample analysis reveals substantial discrepancies: only 65% of Semgrep's and 61% of CodeQL's reports correctly matched the ground truth. These results question the reliability of static analysis tools as sole evaluators of code security and underscore the need for expert feedback. Building on this insight, we propose a conceptual framework that persistently stores human feedback in a dynamic retrieval-augmented generation pipeline, enabling LLMs to reuse past feedback for secure code generation and vulnerability detection.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑