HackerPapers

arXiv:2510.26103cs.CR

Security Vulnerabilities in AI-Generated Code: A Large-Scale Analysis of Public GitHub Repositories

Maximilian Schreiber, Pascal Tippe

HN submission. Found in a submission link or body. Submitters do not count as commenters in the main ranking; a submission is not an endorsement.

Abstract

This paper presents a comprehensive empirical analysis of security vulnerabilities in AI-generated code across public GitHub repositories. We collected and analyzed 7,703 files explicitly attributed to four major AI tools: ChatGPT (91.52\%), GitHub Copilot (7.50\%), Amazon CodeWhisperer (0.52\%), and Tabnine (0.46\%). Using CodeQL static analysis, we identified 4,241 Common Weakness Enumeration (CWE) instances across 77 distinct vulnerability types. Our findings reveal that while 87.9\% of AI-generated code does not contain identifiable CWE-mapped vulnerabilities, significant patterns emerge regarding language-specific vulnerabilities and tool performance. Python consistently exhibited higher vulnerability rates (16.18\%-18.50\%) compared to JavaScript (8.66\%-8.99\%) and TypeScript (2.50\%-7.14\%) across all tools. We observed notable differences in security performance, with GitHub Copilot achieving better security density for Python (1,739 LOC per CWE) and TypeScript, while ChatGPT performed better for JavaScript. Additionally, we discovered widespread use of AI tools for documentation generation (39\% of collected files), an understudied application with implications for software maintainability. These findings extend previous work with a significantly larger dataset and provide valuable insights for developing language-specific and context-aware security practices for the responsible integration of AI-generated code into software development workflows.

arXiv comments
This preprint has not undergone peer review or any post-submission improvements or corrections. The Version of Record of this contribution is published in Volume 16219 of the Lecture Notes in Computer Science series, and is available online at https://doi.org/10.1007/978-981-95-3537-8_9
Journal reference
DOI
doi:10.1007/978-981-95-3537-8_9
Subjects
cs.CRCryptography and Security

On Hacker News

No comments linking this paper were found in the collected sources. Found in 1 HN submission from Jan 2026 to Jan 2026. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments0 threads

No comments linking this paper were found in the collected sources. Open submission discussions.

Submitted to Hacker News

  • Show HN: I made a dev tool that helps vibecoders to AVOID security issues

    The first time I have heard about the vibecoding I could not believe that peeps without the technical background dare to release web apps and other type of software within the week of using such stuff like cursor, claude code and later lovable, bolt.new and etc. I saw some of the projects like that and despite them being somewhat functional - I could feel that security was not the strongest side of these pieces of software. As it turned out I was not hallucinating about the existance of the…

Connected through shared HN threads, not inferred similarity or a recommendation.