DeVAIC:人工智能生成代码的安全评估工具

IF 3.8 2区 计算机科学 Q2 COMPUTER SCIENCE, INFORMATION SYSTEMS
Domenico Cotroneo, Roberta De Luca, Pietro Liguori
{"title":"DeVAIC:人工智能生成代码的安全评估工具","authors":"Domenico Cotroneo,&nbsp;Roberta De Luca,&nbsp;Pietro Liguori","doi":"10.1016/j.infsof.2024.107572","DOIUrl":null,"url":null,"abstract":"<div><h3>Context:</h3><p>AI code generators are revolutionizing code writing and software development, but their training on large datasets, including potentially untrusted source code, raises security concerns. Furthermore, these generators can produce incomplete code snippets that are challenging to evaluate using current solutions.</p></div><div><h3>Objective:</h3><p>This research work introduces <em>DeVAIC</em> (Detection of Vulnerabilities in AI-generated Code), a tool to evaluate the security of AI-generated Python code, which overcomes the challenge of examining incomplete code.</p></div><div><h3>Methods:</h3><p>We followed a methodological approach that involved gathering vulnerable samples, extracting implementation patterns, and creating regular expressions to develop the proposed tool. The implementation of <em>DeVAIC</em> includes a set of detection rules based on regular expressions that cover 35 Common Weakness Enumerations (CWEs) falling under the OWASP Top 10 vulnerability categories.</p></div><div><h3>Results:</h3><p>We utilized four popular AI models to generate Python code, which we then used as a foundation to evaluate the effectiveness of our tool. <em>DeVAIC</em> demonstrated a statistically significant difference in its ability to detect security vulnerabilities compared to the state-of-the-art solutions, showing an <span><math><msub><mrow><mi>F</mi></mrow><mrow><mn>1</mn></mrow></msub></math></span> Score and Accuracy of 94% while maintaining a low computational cost of 0.14 s per code snippet, on average.</p></div><div><h3>Conclusions:</h3><p>The proposed tool provides a lightweight and efficient solution for vulnerability detection even on incomplete code.</p></div>","PeriodicalId":54983,"journal":{"name":"Information and Software Technology","volume":"177 ","pages":"Article 107572"},"PeriodicalIF":3.8000,"publicationDate":"2024-09-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://www.sciencedirect.com/science/article/pii/S0950584924001770/pdfft?md5=4b13436df2c73b1417f75ea09a77256f&pid=1-s2.0-S0950584924001770-main.pdf","citationCount":"0","resultStr":"{\"title\":\"DeVAIC: A tool for security assessment of AI-generated code\",\"authors\":\"Domenico Cotroneo,&nbsp;Roberta De Luca,&nbsp;Pietro Liguori\",\"doi\":\"10.1016/j.infsof.2024.107572\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<div><h3>Context:</h3><p>AI code generators are revolutionizing code writing and software development, but their training on large datasets, including potentially untrusted source code, raises security concerns. Furthermore, these generators can produce incomplete code snippets that are challenging to evaluate using current solutions.</p></div><div><h3>Objective:</h3><p>This research work introduces <em>DeVAIC</em> (Detection of Vulnerabilities in AI-generated Code), a tool to evaluate the security of AI-generated Python code, which overcomes the challenge of examining incomplete code.</p></div><div><h3>Methods:</h3><p>We followed a methodological approach that involved gathering vulnerable samples, extracting implementation patterns, and creating regular expressions to develop the proposed tool. The implementation of <em>DeVAIC</em> includes a set of detection rules based on regular expressions that cover 35 Common Weakness Enumerations (CWEs) falling under the OWASP Top 10 vulnerability categories.</p></div><div><h3>Results:</h3><p>We utilized four popular AI models to generate Python code, which we then used as a foundation to evaluate the effectiveness of our tool. <em>DeVAIC</em> demonstrated a statistically significant difference in its ability to detect security vulnerabilities compared to the state-of-the-art solutions, showing an <span><math><msub><mrow><mi>F</mi></mrow><mrow><mn>1</mn></mrow></msub></math></span> Score and Accuracy of 94% while maintaining a low computational cost of 0.14 s per code snippet, on average.</p></div><div><h3>Conclusions:</h3><p>The proposed tool provides a lightweight and efficient solution for vulnerability detection even on incomplete code.</p></div>\",\"PeriodicalId\":54983,\"journal\":{\"name\":\"Information and Software Technology\",\"volume\":\"177 \",\"pages\":\"Article 107572\"},\"PeriodicalIF\":3.8000,\"publicationDate\":\"2024-09-16\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"https://www.sciencedirect.com/science/article/pii/S0950584924001770/pdfft?md5=4b13436df2c73b1417f75ea09a77256f&pid=1-s2.0-S0950584924001770-main.pdf\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Information and Software Technology\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://www.sciencedirect.com/science/article/pii/S0950584924001770\",\"RegionNum\":2,\"RegionCategory\":\"计算机科学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q2\",\"JCRName\":\"COMPUTER SCIENCE, INFORMATION SYSTEMS\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Information and Software Technology","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0950584924001770","RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q2","JCRName":"COMPUTER SCIENCE, INFORMATION SYSTEMS","Score":null,"Total":0}
引用次数: 0

摘要

背景:人工智能代码生成器正在为代码编写和软件开发带来革命性的变化,但它们在大型数据集(包括潜在的不信任源代码)上的训练引发了安全问题。此外,这些生成器可能会生成不完整的代码片段,使用当前的解决方案对其进行评估具有挑战性。方法:我们采用了一种方法论方法,包括收集易受攻击的样本、提取实现模式和创建正则表达式来开发拟议的工具。DeVAIC的实现包括一套基于正则表达式的检测规则,这些规则涵盖了OWASP十大漏洞类别下的35个常见弱点枚举(CWE)。与最先进的解决方案相比,DeVAIC 在检测安全漏洞的能力方面具有显著的统计学差异,其 F1 分数和准确率均达到 94%,同时保持了较低的计算成本(平均每个代码片段 0.14 秒)。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
DeVAIC: A tool for security assessment of AI-generated code

Context:

AI code generators are revolutionizing code writing and software development, but their training on large datasets, including potentially untrusted source code, raises security concerns. Furthermore, these generators can produce incomplete code snippets that are challenging to evaluate using current solutions.

Objective:

This research work introduces DeVAIC (Detection of Vulnerabilities in AI-generated Code), a tool to evaluate the security of AI-generated Python code, which overcomes the challenge of examining incomplete code.

Methods:

We followed a methodological approach that involved gathering vulnerable samples, extracting implementation patterns, and creating regular expressions to develop the proposed tool. The implementation of DeVAIC includes a set of detection rules based on regular expressions that cover 35 Common Weakness Enumerations (CWEs) falling under the OWASP Top 10 vulnerability categories.

Results:

We utilized four popular AI models to generate Python code, which we then used as a foundation to evaluate the effectiveness of our tool. DeVAIC demonstrated a statistically significant difference in its ability to detect security vulnerabilities compared to the state-of-the-art solutions, showing an F1 Score and Accuracy of 94% while maintaining a low computational cost of 0.14 s per code snippet, on average.

Conclusions:

The proposed tool provides a lightweight and efficient solution for vulnerability detection even on incomplete code.

求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
Information and Software Technology
Information and Software Technology 工程技术-计算机:软件工程
CiteScore
9.10
自引率
7.70%
发文量
164
审稿时长
9.6 weeks
期刊介绍: Information and Software Technology is the international archival journal focusing on research and experience that contributes to the improvement of software development practices. The journal''s scope includes methods and techniques to better engineer software and manage its development. Articles submitted for review should have a clear component of software engineering or address ways to improve the engineering and management of software development. Areas covered by the journal include: • Software management, quality and metrics, • Software processes, • Software architecture, modelling, specification, design and programming • Functional and non-functional software requirements • Software testing and verification & validation • Empirical studies of all aspects of engineering and managing software development Short Communications is a new section dedicated to short papers addressing new ideas, controversial opinions, "Negative" results and much more. Read the Guide for authors for more information. The journal encourages and welcomes submissions of systematic literature studies (reviews and maps) within the scope of the journal. Information and Software Technology is the premiere outlet for systematic literature studies in software engineering.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信