AI-Generated Code Introduces New Security Weaknesses, Study Finds
A new study reveals that AI coding assistants, while adept at avoiding classic vulnerabilities, frequently introduce new risks like denial-of-service flaws and hardcoded secrets.

Modern AI coding assistants are revolutionizing software development, enabling rapid creation of production-ready applications. However, as organizations increasingly adopt these tools, a critical question arises: what novel security vulnerabilities are being introduced?
A comprehensive study by Xint.io analyzed 28 AI-coded applications across various development workflows and models. Researchers identified 434 verified security vulnerabilities, providing a detailed look into the specific security flaws prevalent in AI-generated software. The study evaluated applications generated from detailed specifications, minimal prompts, and those tasked with modernizing existing code.
The findings indicate that leading large language models consistently produce weaknesses related to operational resilience, authentication, complex insecure direct object references (IDOR), and hardcoded secrets. Notably, classic injection flaws like SQLi and XSS, along with basic access control bugs, were significantly less frequent, suggesting AI models have improved in these traditional areas. This indicates AI is not simply replicating past coding mistakes but is introducing a new class of issues.
The most common category of vulnerabilities identified was resource exhaustion and denial-of-service (DoS) weaknesses, accounting for 21% of the total findings. These often stem from missing rate limiting, unbounded operations, and poor resource management, which can lead to unexpected server costs or outages. While these issues were present in most analyzed projects, they typically require specific conditions to be exploited and are often overlooked as AI models prioritize functionality over robust operational resilience under stress.
When focusing on critical-severity vulnerabilities, secret exposure emerged as the leading cause. Nearly half of the 23 critical vulnerabilities found involved hardcoded or predictable application secrets, such as default encryption keys or embedded credentials. This is likely due to AI models replicating insecure patterns found in public training data, where placeholder secrets are common and often don't prevent initial functionality, but can be exploited by attackers to gain unauthorized access.
The study also highlighted how application complexity influences the types of vulnerabilities introduced. Smaller, simpler applications tended to exhibit fewer authorization failures and were more prone to operational control weaknesses. However, as applications grew more complex, authorization issues and IDOR flaws became more dominant. This suggests AI models struggle with the localized logic required for granular permission models in larger, more intricate software.
While AI coding assistants offer significant productivity gains, this research underscores the critical need for rigorous security review of AI-generated code. Developers must be aware of these emerging vulnerability patterns, particularly concerning operational resilience and secret management, to ensure the secure development of AI-assisted applications. The findings suggest a shift in security focus is necessary, moving beyond traditional injection flaws to address the unique challenges posed by AI-generated software.
Organizations leveraging AI for code generation must implement robust security testing and validation processes. This includes specialized testing for DoS vulnerabilities, thorough code audits for hardcoded secrets, and comprehensive authorization checks, especially in complex applications. The study serves as a crucial reminder that while AI can accelerate development, it does not eliminate the fundamental need for secure software development practices.