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

FormAI 数据集:通过形式化验证视角审视软件安全中的生成式人工智能

The FormAI Dataset: Generative AI in Software Security Through the Lens of Formal Verification

Technology Innovation Institute(技术创新研究院);The University of Oslo(奥斯陆大学);University of Manchester(曼彻斯特大学)

Norbert Tihanyi, Tamas Bisztray, Ridhi Jain, Mohamed Amine Ferrag, Lucas C. Cordeiro, Vasileios Mavroeidis

AI总结:

本文提出 FormAI 数据集,包含 112,000 个由 GPT-3.5-turbo 生成并标注漏洞的 C 程序,通过 ESBMC 形式化验证发现其中 51.24% 存在漏洞,为训练模型和评估软件安全风险提供了资源。

摘要:

本文介绍了 FormAI 数据集,这是一个包含 112,000 个由人工智能生成、可编译且相互独立的 C 程序的大型集合,并带有漏洞分类。我们引入了一种动态零样本提示技术,该技术旨在利用大型语言模型(LLMs)生成多样化的程序。该数据集由 GPT-3.5-turbo 生成,包含复杂度各异的程序。有些程序处理网络管理、桌面游戏或加密等复杂任务,而另一些程序则处理字符串操作等较简单的任务。每个程序都标注了源代码中发现的漏洞,指明漏洞类型、行号和易受攻击的函数名称。这是通过采用一种形式化验证方法实现的,该方法使用基于 SMT 的高效有界模型检查器(ESBMC),它利用模型检查、抽象解释、约束规划和可满足性模理论来推理程序中的安全/安保属性。这种方法能够确定性地检测漏洞,并提供一种被称为反例的形式化模型,从而消除了产生误报的可能性。我们已将识别出的漏洞与通用弱点枚举(CWE)编号关联起来。我们公开了这 112,000 个程序的源代码,并附带一个单独的文件,其中包含在每个程序中检测到的漏洞,使该数据集成为训练 LLMs 和机器学习算法的理想选择。我们的研究表明,根据 ESBMC 的检测,GPT-3.5 生成的程序中有 51.24% 包含漏洞,从而对软件安全和安保构成了相当大的风险。

英文摘要:

This paper presents the FormAI dataset, a large collection of 112, 000 AI-generated compilable and independent C programs with vulnerability classification. We introduce a dynamic zero-shot prompting technique constructed to spawn diverse programs utilizing Large Language Models (LLMs). The dataset is generated by GPT-3.5-turbo and comprises programs with varying levels of complexity. Some programs handle complicated tasks like network management, table games, or encryption, while others deal with simpler tasks like string manipulation. Every program is labeled with the vulnerabilities found within the source code, indicating the type, line number, and vulnerable function name. This is accomplished by employing a formal verification method using the Efficient SMT-based Bounded Model Checker (ESBMC), which uses model checking, abstract interpretation, constraint programming, and satisfiability modulo theories to reason over safety/security properties in programs. This approach definitively detects vulnerabilities and offers a formal model known as a counterexample, thus eliminating the possibility of generating false positive reports. We have associated the identified vulnerabilities with Common Weakness Enumeration (CWE) numbers. We make the source code available for the 112, 000 programs, accompanied by a separate file containing the vulnerabilities detected in each program, making the dataset ideal for training LLMs and machine learning algorithms. Our study unveiled that according to ESBMC, 51.24% of the programs generated by GPT-3.5 contained vulnerabilities, thereby presenting considerable risks to software safety and security.

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

↑