arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2308.10345cs.SEcs.LG
收藏

大型语言模型能否发现并修复有漏洞的软件?

Can Large Language Models Find And Fix Vulnerable Software?

PeopleTec(皮奥泰克公司)

David Noever

AI总结:

本研究评估GPT-4等大语言模型的软件漏洞检测修复能力,发现其检测量是传统工具四倍、修复使漏洞降90%且误报低,具备自我审计能力,为代码安全审计提供新方向。

摘要:

本研究评估了大型语言模型(LLMs),尤其是OpenAI的GPT-4,在检测软件漏洞方面的能力,并将其性能与Snyk、Fortify等传统静态代码分析工具进行对比。我们的分析覆盖了包括NASA和美国国防部项目在内的众多代码仓库。GPT-4发现的漏洞数量约为同类传统工具的四倍,此外它还能为每个漏洞提供可行的修复方案,且误报率很低。我们的测试涵盖8种编程语言的129个代码样本,发现PHP和JavaScript中的漏洞数量最多。GPT-4的代码修正使漏洞减少了90%,仅需增加11%的代码行数。一项关键发现是LLMs具备自我审计能力,能够为自己发现的漏洞提出修复方案,凸显了其精准性。未来研究应探索系统级漏洞,并整合多种静态代码分析工具,以全面评估LLMs的潜力。

英文摘要:

In this study, we evaluated the capability of Large Language Models (LLMs), particularly OpenAI's GPT-4, in detecting software vulnerabilities, comparing their performance against traditional static code analyzers like Snyk and Fortify. Our analysis covered numerous repositories, including those from NASA and the Department of Defense. GPT-4 identified approximately four times the vulnerabilities than its counterparts. Furthermore, it provided viable fixes for each vulnerability, demonstrating a low rate of false positives. Our tests encompassed 129 code samples across eight programming languages, revealing the highest vulnerabilities in PHP and JavaScript. GPT-4's code corrections led to a 90% reduction in vulnerabilities, requiring only an 11% increase in code lines. A critical insight was LLMs' ability to self-audit, suggesting fixes for their identified vulnerabilities and underscoring their precision. Future research should explore system-level vulnerabilities and integrate multiple static code analyzers for a holistic perspective on LLMs' potential.

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

↑