Veracode's 2025 GenAI Code Security Report tested more than 100 large language models in Java, Python, C# and JavaScript. In 45% of the samples, the generated code failed security tests and introduced OWASP Top 10 vulnerabilities. Java was the riskiest language, with a 72% security failure rate. One of the most frequent issues was cross-site scripting: the AI tools failed to defend against it in 86% of the relevant samples.
Veracode kept the same test, with 80 coding tasks. By its Spring 2026 update, published in March 2026, it had evaluated more than 150 models. Syntax correctness exceeded 95%, but the security pass rate stayed at about 55%, virtually the same as two years earlier. The pass rate was 82% against SQL injection, but only 15% against cross-site scripting and 13% against log injection, flaws that require following data through the code.