The Impact of Using Large Language Models for Code Generation on Software Security
Main Article Content
Abstract
Automated code generation has been drastically altered by the integration of Large Language Models into modern software engineering processes. However, the security dangers related to code produced by AI continue to be a significant threat to software reliability. A thorough summary of research from 2022 to 2026, that examines how code completion and synthesis using LLM affect software security is presented in this research paper. Following PRISMA guidelines. Through 5 prominent digital repositories: IEEE Xplore, ACM Digital Library, Scopus, Science Direct, and arXiv. 55 primary studies were systematically recovered and evaluated. The study shows that, even if LLMs considerably quicken the pace of development, open source and commercial models including GitHub Copilot (powered by OpenAI Codex/GPT-4o), OpenAI GPT-3.5-Turbo and GPT-4, Meta Llama 2 (13B/70B) and Llama 3 (8B/70B), as well as CodeLlama (7B/13B/34B/70B-Python)frequently introduce critical vulner abilitiess such as Cross-Site Scripting (CWE79), Buffer Overflows (CWE 119/120), and SQL Injection (CWE 89).These flaws correspond precisely to the shortcomings enumerated in the Common Weakness Enumeration CWE and OWASP Top 10.To fix these security flaws, literature suggests four main defense vectors: agentic guardrail frameworks, oracle-guided model fine-tuning, static analysis feedback loops, and security aware prompt engineering. This paper combines these discoveries into a single taxonomy, assesses the benchmark performance of models, and defines strategic future research areas to enable secure AI-assisted software synthesis.