Security Assessment of AI-Generated Code: Vulnerabilities, Detection, Repair, and Open Challenges

Large Language Models (LLMs) are increasingly used to generate code from natural-language prompts, but their outputs may reproduce insecure patterns learned from public repositories and may introduce new weaknesses through incomplete validation, unsafe API use, memory errors, or poor resource handling. This paper presents a literature-based analysis of five supplied studies on the security of AI-generated code. It reviews empirical vulnerability measurements across programming languages, formal verification of large C-code datasets, static analysis of incomplete Python snippets, LLM-assisted vulnerability detection and repair, and binary/runtime analysis. The reviewed evidence reports that 49% of ChatGPT-generated and 55.5% of Bard-generated samples were vulnerable in one multi-language study, while at least 62.07% of programs in the FormAI-v2 C dataset were vulnerable. DeVAIC reported 94% F1-score and accuracy for Python snippet detection, whereas a separate C-code study found that conventional tools missed approximately 53.3% of identified AI-code vulnerabilities. These results are not directly comparable because the datasets, languages, tools, and definitions differ. The paper synthesizes the vulnerability handling lifecycle—detection, localization, and repair—and proposes a layered assessment workflow combining pattern-based static analysis, formal verification, dynamic testing, binary inspection, AI-assisted triage, and human approval. The analysis identifies challenges in false positives, incomplete code, context length, structural variation, repair-induced weaknesses, and reproducibility. It concludes that AI-generated code should be treated as untrusted input and independently verified before deployment. No new experiments are conducted; all numerical findings are attributed to the original studies.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-30
DOI
https://doi.org/10.5281/zenodo.24672481
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

Security Assessment of AI-Generated Code: Vulnerabilities, Detection, Repair, and Open Challenges

Divya Ashok Rahane, Shreyash Shirish Kulkarni
Zenodo (CERN European Organization for Nuclear Research)
Software Engineering Research
article

Security Assessment of AI-Generated Code: Vulnerabilities, Detection, Repair, and Open Challenges

Divya Ashok Rahane, Shreyash Shirish Kulkarni
article en

Abstract

Large Language Models (LLMs) are increasingly used to generate code from natural-language prompts, but their outputs may reproduce insecure patterns learned from public repositories and may introduce new weaknesses through incomplete validation, unsafe API use, memory errors, or poor resource handling. This paper presents a literature-based analysis of five supplied studies on the security of AI-generated code. It reviews empirical vulnerability measurements across programming languages, formal verification of large C-code datasets, static analysis of incomplete Python snippets, LLM-assisted vulnerability detection and repair, and binary/runtime analysis. The reviewed evidence reports that 49% of ChatGPT-generated and 55.5% of Bard-generated samples were vulnerable in one multi-language study, while at least 62.07% of programs in the FormAI-v2 C dataset were vulnerable. DeVAIC reported 94% F1-score and accuracy for Python snippet detection, whereas a separate C-code study found that conventional tools missed approximately 53.3% of identified AI-code vulnerabilities. These results are not directly comparable because the datasets, languages, tools, and definitions differ. The paper synthesizes the vulnerability handling lifecycle—detection, localization, and repair—and proposes a layered assessment workflow combining pattern-based static analysis, formal verification, dynamic testing, binary inspection, AI-assisted triage, and human approval. The analysis identifies challenges in false positives, incomplete code, context length, structural variation, repair-induced weaknesses, and reproducibility. It concludes that AI-generated code should be treated as untrusted input and independently verified before deployment. No new experiments are conducted; all numerical findings are attributed to the original studies.

Zenodo (CERN European Organization for Nuclear Research)
Software Engineering Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon