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

利用大语言模型在源代码漏洞检测中的能力

Harnessing the Power of LLMs in Source Code Vulnerability Detection

AIVault Inc.(AIVault公司)

Andrew A Mahyari

AI总结:

本文提出将源代码转换为LLVM IR并在其上训练大语言模型,以实现跨编程语言的通用漏洞检测,在NVD和SARD数据集上验证了高准确性。

摘要:

软件漏洞源于源代码中的无意缺陷,是网络攻击的主要根本原因。源代码静态分析已被广泛用于检测软件开发人员引入的这些无意缺陷。大语言模型(LLMs)由于能够捕捉序列数据(如自然语言)中的复杂模式,已展现出类似人类的对话能力。在本文中,我们利用LLMs的能力来分析源代码并检测已知漏洞。为确保所提出的漏洞检测方法在多种编程语言中具有通用性,我们将源代码转换为LLVM IR,并在这些中间表示上训练LLMs。我们对多种LLM架构进行了广泛实验,并比较了它们的准确性。我们在来自NVD和SARD的真实世界及合成代码上的综合实验表明,该方法在识别源代码漏洞方面具有很高的准确性。

英文摘要:

Software vulnerabilities, caused by unintentional flaws in source code, are a primary root cause of cyberattacks. Static analysis of source code has been widely used to detect these unintentional defects introduced by software developers. Large Language Models (LLMs) have demonstrated human-like conversational abilities due to their capacity to capture complex patterns in sequential data, such as natural languages. In this paper, we harness LLMs' capabilities to analyze source code and detect known vulnerabilities. To ensure the proposed vulnerability detection method is universal across multiple programming languages, we convert source code to LLVM IR and train LLMs on these intermediate representations. We conduct extensive experiments on various LLM architectures and compare their accuracy. Our comprehensive experiments on real-world and synthetic codes from NVD and SARD demonstrate high accuracy in identifying source code vulnerabilities.

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

↑