Skip to content

AI Reliably Finds Zero-Days but Still Writes Insecure Code

Bottom line: Despite growing capability to find and exploit zero-day vulnerabilities, current AI models still produce insecure code in up to 44 percent of cases, according to several independent studies, with little improvement over time.

Recent studies reveal a widening asymmetry between offensive and defensive AI capabilities: while LLMs are increasingly able to find and exploit security vulnerabilities, their ability to generate secure code or cleanly patch vulnerabilities is barely improving.

An investigation by application security vendor Veracode shows that 44 percent of AI-generated code contains at least one known vulnerability from the OWASP Top 10. Even the most capable current frontier models failed to exceed a 68 percent success rate in security tests — in plain terms, that means one in three code samples still contains insecure code. Across four rounds of testing that Veracode conducted over the past year involving more than 100 model versions in total, the average security rate barely improved. At the same time, all tested models produced syntactically correct code in 99 percent of cases. Chris Wysopal, Chief Security Evangelist at Veracode, sums up the discrepancy: models are getting increasingly better at writing exploit code, but not at generating secure code — a question he directs squarely at the AI labs.

Further research confirms the trend. Dutch software quality firm Software Improvement Group (SIG) finds in its “State of Software 2026” report that AI-generated code shows roughly twice as many security risk violations as human-written code. SIG CTO Jasper Geurts emphasizes that 71 percent of all code examined — not just AI-generated code — exhibits a low security level. According to him, AI did not create the problem but is amplifying existing weaknesses in organizations’ software development practices. A study by Xint.io, a code security platform developed by Theori, adds further nuance: in tests with five current models from Anthropic and OpenAI, tasked with both “vibe-coding” new applications and re-architecting an existing application, researchers found a total of 434 validated security vulnerabilities across 28 app variants — 196 in newly generated code and 238 in reworked legacy code.

According to Kay Kwak, Product Owner for Xint at Theori, the most common flaws involve code that compiles and runs but contains embedded secrets or consumes excessive resources at scale. He partly attributes this to shortcuts present in the training data, as well as to the fact that developers rarely specify protective mechanisms explicitly when requesting features. Additionally, AI increasingly loses track of granular user permissions in larger, more complex codebases. This weakness also shows up when closing known vulnerabilities: research from 1Password’s Off-By-1 Labs, which tested various models on generating patches for six known, already-fixed vulnerabilities in complex open-source projects, documented comparable quality issues across more than 6,000 test runs.

For CISOs, this paints a concrete risk picture: AI-assisted development accelerates software delivery but, without established quality and security controls, can equally increase technical debt and attack surface. As attackers increasingly use AI to automatically find and exploit vulnerabilities, the gap between offensive and defensive capabilities is widening. Organizations deploying AI-generated code in production should establish mandatory security reviews, automated scanning against OWASP criteria, and explicit guardrail instructions in prompts as a fixed part of their development processes, rather than relying on the models to self-correct.


Source: www.csoonline.com · Published August 18, 2026
Lumi AI News — AI-assisted curation pursuant to Art. 50 EU AI Act. Paraphrasing and classification by Lumi News Pipeline v1.8.3.

Share on: