arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.10072cs.CRcs.AI
收藏

为何大语言模型失败:自动化安全补丁生成的失败分析与部分成功测量

Why LLMs Fail: A Failure Analysis and Partial Success Measurement for Automated Security Patch Generation

University of Passau(帕绍大学)

Amir Al-Maamari

AI总结:

本研究分析了LLM在生成安全补丁时的失败原因,指出其在安全性和功能上的不足,并提出安全修复评分以量化这一差距。

摘要:

大型语言模型(LLMs)在自动化程序修复(APR)中展现出潜力,但其在安全漏洞上的有效性仍缺乏充分描述。本研究分析了来自Vul4J基准的64个Java漏洞中生成的319个LLM安全补丁。通过三轴评估(编译性、安全视角测试、功能测试套件),分析发现仅24.8%的补丁达到完全正确性,而51.4%的补丁在安全性和功能上均失败。主要的失败模式是语义误解:LLMs生成的代码在语法上是正确的,但应用了错误的修复策略。所提出的安全修复分数(SRS)量化了这一差距,显示LLMs在功能方面(平均0.832)表现良好,但在安全方面(平均0.251)表现不佳。漏洞类型强烈预测难度,修复率从0%(输入验证)到45%(无限循环)不等。这些发现表明,在部署前LLM的安全补丁需要严格验证。

英文摘要:

Large Language Models (LLMs) show promise for Automated Program Repair (APR), yet their effectiveness on security vulnerabilities remains poorly characterized. This study analyzes 319 LLM-generated security patchesacross 64 Java vulnerabilities from the Vul4J benchmark. Using tri-axis evaluation (compilation, security via PoV tests, functionality via test suites), the analysis reveals that only 24.8% of patches achieve full correctness, while 51.4% fail both security and functionality. The dominant failure mode is semantic misunderstanding: LLMs produce syntactically valid code but apply incorrect repair strategies. The proposed Security Repair Score (SRS) quantifies this gap, showing LLMs preserve functionality (mean 0.832) but struggle with security (mean 0.251). Vulnerability type strongly predicts difficulty, with fix rates ranging from 0% (input validation) to 45% (infinite loop). These findings demonstrate that LLM security patches require rigorous validation before deployment.

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

↑