Security Vulnerability Analysis Of AI-Generated Code: A Penetration Testing Approach

  • Unique Paper ID: 207261
  • PageNo: 153-157
  • Abstract:
  • The rapid adoption of AI-powered code generation tools has significantly accelerated software development while simultaneously introducing critical security concerns. This study presents a comprehensive vulnerability analysis of AI-generated code using penetration testing methodologies combined with dataset-driven evaluation. A dataset of 1000 vulnerable code samples were analysed to identify patterns in SQL Injection (SQLi) and Cross-Site Scripting (XSS) vulnerabilities. Statistical analysis reveals that SQLi vulnerabilities exhibit higher code complexity with an average token length of 99.39 compared to 64.13 for XSS, indicating deeper backend security risks. Comparative analysis further demonstrates that approximately 39.4% of AI-generated code contains exploitable vulnerabilities, highlighting a substantial real-world security risk. This study provides structured insights into vulnerability distribution, complexity patterns, and detection challenges, emphasizing the need for robust security validation in AI-assisted software development environments.

Copyright & License

Copyright © 2026 Authors retain the copyright of this article. This article is an open access article distributed under the Creative Commons Attribution License which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

BibTeX

@article{207261,
        author = {Romaer Ahuja and Nikita and Aditya Singh and Rahul Mishra},
        title = {Security Vulnerability Analysis Of AI-Generated Code: A Penetration Testing Approach},
        journal = {International Journal of Innovative Research in Technology},
        year = {2026},
        volume = {13},
        number = {no},
        pages = {153-157},
        issn = {2349-6002},
        url = {https://ijirt.org/article?manuscript=207261},
        abstract = {The rapid adoption of AI-powered code generation tools has significantly accelerated software development while simultaneously introducing critical security concerns. This study presents a comprehensive vulnerability analysis of AI-generated code using penetration testing methodologies combined with dataset-driven evaluation. A dataset of 1000 vulnerable code samples were analysed to identify patterns in SQL Injection (SQLi) and Cross-Site Scripting (XSS) vulnerabilities. Statistical analysis reveals that SQLi vulnerabilities exhibit higher code complexity with an average token length of 99.39 compared to 64.13 for XSS, indicating deeper backend security risks. Comparative analysis further demonstrates that approximately 39.4% of AI-generated code contains exploitable vulnerabilities, highlighting a substantial real-world security risk. This study provides structured insights into vulnerability distribution, complexity patterns, and detection challenges, emphasizing the need for robust security validation in AI-assisted software development environments.},
        keywords = {AI Code Generation, Cybersecurity, Vulnerability Analysis, SQL Injection, Cross-Site Scripting, Penetration Testing, OWASP Top 10, Static Analysis},
        month = {July},
        }

Cite This Article

Ahuja, R., & Nikita, , & Singh, A., & Mishra, R. (2026). Security Vulnerability Analysis Of AI-Generated Code: A Penetration Testing Approach. International Journal of Innovative Research in Technology (IJIRT), 153–157.

Related Articles