DeVAIC: : A tool for security assessment of AI-generated code

被引:1
|
作者
Cotroneo, Domenico [1 ]
De Luca, Roberta [1 ]
Liguori, Pietro [1 ]
机构
[1] Univ Naples Federico II, I-80125 Naples, Italy
关键词
Static code analysis; Vulnerability detection; AI-code generators; !text type='Python']Python[!/text; STATIC ANALYSIS; CHATGPT;
D O I
10.1016/j.infsof.2024.107572
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
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 F 1 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.
引用
收藏
页数:15
相关论文
共 50 条
  • [1] Navigating (in)security of AI-generated code
    Ambati, Sri Haritha
    Ridley, Norah
    Branca, Enrico
    Stakhanova, Natalia
    2024 IEEE INTERNATIONAL CONFERENCE ON CYBER SECURITY AND RESILIENCE, CSR, 2024, : 30 - 37
  • [2] Automating the correctness assessment of AI-generated code for security contexts
    Cotroneo, Domenico
    Foggia, Alessio
    Improta, Cristina
    Liguori, Pietro
    Natella, Roberto
    JOURNAL OF SYSTEMS AND SOFTWARE, 2024, 216
  • [3] Poisoning Programs by Un-Repairing Code: Security Concerns of AI-generated Code
    Improta, Cristina
    2023 IEEE 34TH INTERNATIONAL SYMPOSIUM ON SOFTWARE RELIABILITY ENGINEERING WORKSHOPS, ISSREW, 2023, : 128 - 131
  • [4] AI-Generated Code Not Considered Harmful
    Kendon, Tyson
    Wu, Leanne
    Aycock, John
    PROCEEDINGS OF THE 25TH WESTERN CANADIAN CONFERENCE ON COMPUTING EDUCATION, 2023,
  • [5] ColDeco: An End User Spreadsheet Inspection Tool for AI-Generated Code
    Ferdowsi, Kasra
    Williams, Jack
    Drosos, Ian
    Gordon, Andrew D.
    Negreanu, Carina
    Polikarpova, Nadia
    Sarkar, Advait
    Zorn, Benjamin
    2023 IEEE SYMPOSIUM ON VISUAL LANGUAGES AND HUMAN-CENTRIC COMPUTING, VL/HCC, 2023, : 82 - 91
  • [6] Validating AI-Generated Code with Live Programming
    Ferdowsi, Kasra
    Huang, Ruanqianqian
    James, Michael B.
    Polikarpova, Nadia
    Lerner, Sorin
    PROCEEDINGS OF THE 2024 CHI CONFERENCE ON HUMAN FACTORS IN COMPUTING SYTEMS (CHI 2024), 2024,
  • [7] Double-Edged Sword of LLMs: Mitigating Security Risks of AI-Generated Code
    Bharadwaj, Ramesh
    Parker, Ilya
    DISRUPTIVE TECHNOLOGIES IN INFORMATION SCIENCES VII, 2023, 12542
  • [8] Exploring the Boundaries Between LLM Code Clone Detection and Code Similarity Assessment on Human and AI-Generated Code
    Zhang, Zixian
    Saber, Takfarinas
    BIG DATA AND COGNITIVE COMPUTING, 2025, 9 (02)
  • [9] Creating Thorough Tests for AI-Generated Code is Hard
    Singhal, Shreya
    Kumar, Viraj
    PROCEEDINGS OF THE 16TH ANNUAL ACM INDIA COMPUTE CONFERENCE, COMPUTE 2023, 2023, : 108 - 111
  • [10] Assessing AI Detectors in Identifying AI-Generated Code: Implications for Education
    Pan, Wei Hung
    Chok, Ming Jie
    Wong, Jonathan Leong Shan
    Shin, Yung Xin
    Poon, Yeong Shian
    Yang, Zhou
    Chong, Chun Yong
    Lo, David
    Lim, Mei Kuan
    2024 ACM/IEEE 44TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING: SOFTWARE ENGINEERING EDUCATION AND TRAINING, ICSE-SEET 2024, 2024, : 1 - 11