Toutes les vulnérabilités
HIGHAI/LLM

AI-VIBE-CODED-INSECURE-2025

AI coding · AI-generated application code (LLM coding assistants)

Résumé

Large-scale 2025 studies confirm that AI coding assistants emit insecure code at a high baseline rate, and that unreviewed 'vibe-coded' output ships those flaws to production. Veracode's 2025 GenAI Code Security Report (July 30, 2025), which evaluated over 100 LLMs across 80+ coding tasks in Java, Python, C# and JavaScript, found 45% of AI-generated samples introduced an OWASP Top 10 vulnerability, with an 86% failure rate on cross-site scripting and 88% on log injection, and security performance stayed flat regardless of model size or release date. The mechanism is that LLMs predict statistically likely code from training data rather than reasoning about security invariants, so they default to unparameterized SQL queries, unencoded output, hardcoded secrets and weak cryptography unless explicitly constrained. Stanford's user study 'Do Users Write More Insecure Code with AI Assistants?' (Perry, Srivastava, Kumar, Boneh; ACM CCS 2023) found that developers given an AI assistant wrote significantly less secure code, especially for encryption and SQL injection, yet were more confident their code was secure, removing the human skepticism that would otherwise catch the flaw. When this output is accepted and merged without review, SQLi, XSS, secret exposure and weak-crypto defects propagate into shipped software at scale.

Comment l’éviter dans votre code

  • Treat all AI-generated code as untrusted: require mandatory human security review and automated SAST/secret scanning on every AI-authored PR.
  • Block auto-accept and auto-merge of agent output; gate merges on passing security checks.
  • Add language-aware guardrails for SQL, output encoding, crypto and secrets to catch the common AI failure classes.
  • Train developers that AI assistance increases overconfidence; mandate explicit verification of security-sensitive code paths.
  • Inventory and rescan existing AI-generated code already in the stack, including vendor and open-source contributions.

Références

Vulnérabilités liées

Tout AI/LLM →