AI-written code brings its own vulnerabilities
October 14, 2026
Vulnerabilities traced back to AI coding tools are rising fast, and AI suggests packages that don't exist. What the research shows, and what to do about it.
More of the code you run is written by AI
AI coding assistants have become part of how a lot of software is written - in the open-source projects your distribution packages, in the tools you install from pip or npm, and in your own team's applications. That speeds things up. It also means the mistakes AI tools tend to make end up in software running on real machines.
Vulnerabilities traced back to AI tools
Researchers at Georgia Tech's Vibe Security Radar project scanned over 43,000 published security advisories, followed each vulnerability back to the code change that introduced it, and checked whether that change was made with an AI coding tool. By April 2026 they had confirmed 74 cases - 14 rated critical and 25 high - mostly command injection, authentication bypass and server-side request forgery.
The trend is steep: around 18 cases in the second half of 2025, then 56 in the first three months of 2026, including 35 in March alone. And the method only catches code that still carries a visible AI signature, like a co-author tag in the commit, so the real number is certainly higher.
The researchers also point to a pattern that's specific to AI: when millions of developers use the same few models, the same mistakes show up in many unrelated projects at once.
How often AI writes insecure code
Controlled tests point the same way. In Veracode's GenAI Code Security Report, more than 100 language models completed 80 coding tasks where both a secure and an insecure solution were possible. In 45% of the cases, the generated code introduced a vulnerability from the OWASP Top 10, the best-known list of web security risks. Newer models wrote code that compiled more often, but not more securely. The tasks were chosen to test for known weaknesses, so the figure says more about tendencies than about all AI-written code - but the tendency is clear.
Packages that don't exist - yet
AI tools sometimes suggest installing packages that don't exist. A study presented at USENIX Security 2025 generated 576,000 code samples with 16 models and found that, on average, at least 5.2% of the packages suggested by commercial models and 21.7% of those suggested by open-source models were made up - over 205,000 unique invented names.
That creates an opportunity for attackers: register a package under a name AI tools tend to invent, and wait for someone to install it. The attack has been given its own name, slopsquatting.
What it means for your machines
For the software you install, AI-written code is one more reason the stream of vulnerabilities keeps growing - alongside AI tools that are getting better at finding them, as described in AI is finding more vulnerabilities. You can't review every upstream project, but you can make sure fixes reach your machines quickly when they're published.
For code your own team writes with AI help:
- Review it like code from a new colleague. Pay extra attention to authentication, input handling and anything that builds shell commands or file paths.
- Check that dependencies exist and are what you think. Before adding a package an assistant suggested, check that it's the real, maintained project.
- Let tools check it too. Static analysis and dependency auditing catch many of the common patterns automatically. On deployed machines, the
pip-audit.shandnpm-audit.shplugins keep auditing a project's dependencies after release. - Keep dependencies updated after release. Code that ships with a frozen lock file stays as vulnerable as the day it was built - see Who keeps your packages secure?
Sources
- Georgia Tech: Bad Vibes: AI-Generated Code Is Vulnerable, Researchers Warn, April 13, 2026
- Veracode: GenAI Code Security Report, 2025
- Spracklen et al.: We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs, USENIX Security 2025