Nearly half of all code generated by AI found to contain security flaws – even big LLMs affected
- Report finds 45% of AI-generated code had security flaws
- Java is the worst offender, Python, C# and JavaScript also affected
- Rise in vibe coding could make these threats even worse
Nearly half (45%) of AI-generated code contains security flaws despite appearing production-ready, new research from Veracode has found.
Its study of more than 100 large language models across 80 different coding tasks revealed no improvement in security across newer or larger models – an alarming reality for companies that rely on AI tools to back up, or even replace, human productivity.
Java was found to be the worst affected, with 70%+ failure rate, but Python, C# and JavaScript also had failure rates of 38-45%.
AI-generated code isn’t so secure after all
The news comes as more and more developers rely on generative AI to help them get code written – as much as a third of new Google and Microsoft code could now be AI-generated.
“The rise of vibe coding, where developers rely on AI to generate code, typically without explicitly defining security requirements, represents a fundamental shift in how software is built,” Veracode CTO Jens Wessling explained.
Veracode found LLMs often chose insecure methods of coding 45% of the time, failing to defend against cross-site scripting (86%) and log injection (88%).
“Our research shows models are getting better at coding accurately but are not improving at security,” Wessling added.
Sign up to the TechRadar Pro newsletter to get all the top news, opinion, features and guidance your business needs to succeed!
Vulnerabilities are also amplified in the modern era of AI – artificial intelligence enables attackers to exploit them faster and at scale.
Veracode suggests developers enable security checks in AI-driven workflows to enforce compliance and security. Companies should also adopt AI remediation guidance to train developers, deploy firewalls and use tools that help help detect flaws earlier.
“AI coding assistants and agentic workflows represent the future of software development… Security cannot be an afterthought if we want to prevent the accumulation of massive security debt,” Wessling concluded.
You might also like
Report finds 45% of AI-generated code had security flaws Java is the worst offender, Python, C# and JavaScript also affected Rise in vibe coding could make these threats even worse Nearly half (45%) of AI-generated code contains security flaws despite appearing production-ready, new research from Veracode has found. Its study…
Recent Posts
- Nintendo confirms it will sell a new Switch 2 with replaceable battery in the EU
- Apple begins requiring age verification for App Store use in Texas
- The co-creator of Scavengers Reign is working on a new show for Netflix
- Apple is bringing age verification to Texas this week
- How to watch NBA Finals 2026: Free streams, schedule, TV channels for New York Knicks vs San Antonio Spurs
Archives
- June 2026
- May 2026
- April 2026
- March 2026
- February 2026
- January 2026
- December 2025
- November 2025
- October 2025
- September 2025
- August 2025
- July 2025
- June 2025
- May 2025
- April 2025
- March 2025
- February 2025
- January 2025
- December 2024
- November 2024
- October 2024
- September 2024
- August 2024
- July 2024
- June 2024
- May 2024
- April 2024
- March 2024
- February 2024
- January 2024
- December 2023
- November 2023
- October 2023
- September 2023
- August 2023
- July 2023
- June 2023