Vibe Coding Security Risks: Why AI-Generated Code Fails Security Review

bs-single-container

When we picture a catastrophic data breach, we imagine a sophisticated adversary: a zero-day exploit, a nation-state team, months of patient reconnaissance. The reality of 2026 is far more mundane. Increasingly, the breach starts with an app that an AI wrote in an afternoon and nobody secured before it went live.

Vibe coding, describing software in plain English and letting an AI assistant build it, has moved from weekend hobby to production workflow. It ships features fast. It also ships vulnerabilities fast, and those flaws don’t show up in the demo. They surface the moment a second user, or an attacker, changes one number in a URL and starts reading someone else’s data.

The uncomfortable truth is that AI writes code that runs, not code that’s safe. Those are two different jobs, and the second one is still yours.

“Working” and “Secure” Aren’t the Same Thing

AI coding assistants are genuinely good at making software function. In Apiiro’s analysis of Fortune 50 repositories, syntax errors in AI-written code dropped by 76% and logic bugs fell by more than 60%, which is exactly why developers feel faster and more confident using them. The problem is what got worse at the same time. Privilege escalation paths jumped 322%, and architectural design flaws climbed 153%. Those are the deep, hard-to-spot vulnerabilities that require real security reasoning to catch, and they’re precisely the ones an AI, or a non-developer accepting its output, tends to miss.

Independent testing keeps landing in the same place. When Veracode ran more than 100 large language models through 80 security-sensitive coding tasks, 45% of the generated code shipped with an OWASP Top 10 vulnerability. That number hasn’t budged since. Veracode’s Spring 2026 update found security pass rates still stuck near 55%, essentially flat across two years of model releases, even as syntax pass rates climbed past 95%. Carnegie Mellon’s SusVibes benchmark reached the same conclusion from a different angle: roughly 61% of AI-generated solutions were functionally correct, and only about 10.5% were secure.

Fewer than 11 in every 100 AI-generated snippets meet basic security standards. With AI now writing a substantial share of all merged code, that failure rate stops being a curiosity and becomes an attack surface.

  • ~45% of AI-generated code contains an OWASP Top 10 vulnerability
  • ~10.5% passes security review, though 61% functions correctly
  • 322% more privilege escalation paths in AI-assisted code than human-only code

The Four Failures Behind Almost Every Vibe-Coding Breach

You don’t need to memorize a hundred vulnerability classes. The plain-English warnings developers trade about insecure vibe-coded apps map onto four old, well-understood failures, and AI reproduces all four at scale because it generates code that looks production-ready before it is.

1. Hardcoded secrets

“API keys sitting in plain text.”

AI assistants routinely embed API keys, database passwords, and tokens directly in code. GitGuardian detected 28.65 million new hardcoded secrets in public GitHub commits during 2025 alone, a 34% jump year over year and the largest single-year rise on record. Commits produced with AI assistance leaked secrets at roughly twice the human-only baseline, and exposures tied to AI services specifically climbed 81% in a single year. Worse still, when GitGuardian retested credentials that first leaked back in 2022, more than 64% were still valid in January 2026.

2. Broken or missing access control

“Databases that trust anyone who asks.”

Popular managed cloud backends ship open by default and require access rules to be configured explicitly. AI-generated apps frequently skip that step, leaving databases readable, and writable, by anyone with the URL. No password required. This one mistake sits behind the largest vibe-coding breaches on record.

3. Insecure Direct Object Reference (IDOR)

“Change one number in a URL and you’re reading someone else’s data.”

The classic authorization flaw, formalized in the OWASP API Security Top 10 as Broken Object Level Authorization. The server hands back a record based on an ID in the request without checking whether the requester is allowed to see it. Increment the ID from /user/1001 to /user/1002 and another person’s data appears. AI reproduces this constantly because the code “works” when you test it with a single account.

4. Mass automated exploitation

“Hackers are scanning for vibe-coded apps.”

Attackers now scan the internet specifically for these predictable patterns, and the yield is good. Escape.tech scanned 5,600 publicly deployed vibe-coded applications and surfaced more than 2,000 high-impact vulnerabilities, over 400 exposed secrets, and 175 instances of exposed personal data including medical records and bank account numbers. Every one of those was live in production and discoverable within hours by anyone motivated to look.

The Numbers Are Moving in the Wrong Direction

Two independent trends show the problem compounding rather than settling: leaked credentials are climbing to record highs, and security flaws formally traced to AI coding tools are growing at an exponential clip.

2025 was the largest single-year jump on record, and leaked secrets on public GitHub have grown 152% since 2021.

The CVE trendline tells the same story at a different altitude. Publicly disclosed vulnerabilities formally traced to AI coding tools rose roughly sixfold between January and March of 2026, with about 74 catalogued through March. The real number is almost certainly higher, because most AI tools leave no identifiable commit metadata behind.

Roughly a 6x rise in new monthly CVEs from January to March 2026. The true count is likely several times higher, because most AI tools leave no identifiable commit metadata.

The pattern is consistent across every study that goes looking for it. A late-2025 Tenzai test of 15 apps built on five leading AI coding platforms found every single tool introduced Server-Side Request Forgery flaws, and not one of the 15 apps set security headers or implemented CSRF protection. The Cloud Security Alliance’s 2026 research note pulls both threads together.

What It Looks Like in the Wild

These aren’t theoretical risks. Between early 2025 and early 2026, researchers catalogued more than 20 documented AI-app breaches, and nearly all of them trace back to the same handful of root causes.

Tea (dating-safety app)

July 2025  |  2M+ users, #1 on the App Store  |  Root cause: broken authentication and authorization

An unsecured Firebase storage bucket exposed roughly 72,000 images, including about 13,000 verification selfies and government IDs. Days later, a second flaw exposed around 1.1 million private messages through an API endpoint with no access-control checks.

Lovable (CVE-2025-48757)

May 2025  |  platform-wide flaw  |  Root cause: missing database access control

Generated apps failed to enable Supabase row-level security. A scan of 1,645 apps found 303 vulnerable endpoints across roughly 170 apps, about 10% of the platform’s public applications leaking user data. Names, emails, home addresses, payment details, and third-party API keys were all reachable.

Base44 (AI app-builder)

July 2025  |  later acquired by Wix  |  Root cause: broken authentication logic

Wiz researchers found an authentication-bypass logic flaw: two undocumented API endpoints let an attacker register and verify accounts using only a publicly visible app ID, then reach private applications behind SSO. Wix patched it within 24 hours.

Moltbook

January 2026  |  founder “wrote no code”  |  Root cause: exposed backend, no access control

An app whose founder publicly said he didn’t write a single line of code exposed roughly 4.75 million database records, including 1.5 million API authentication tokens and 35,000 user email addresses. The Supabase key sat in client-side JavaScript with no row-level security behind it.

Individually, each of these reads like carelessness. Together they read like a structural problem in the AI-app ecosystem, which is exactly what the large-scale audits keep confirming.

Three Controls AI Almost Always Skips

Most vibe-coded apps aren’t taken down by an exotic exploit. They break because ordinary production safeguards were never added: the AI wasn’t asked for them, so it didn’t include them. Three of these missing controls trip up almost every AI-built app, and each one is inexpensive to add once you know to look for it.

1. The authentication checklist you can’t ship without

AI can generate a login system that works perfectly in a demo and still skips every safeguard that matters in production. Before you ship an AI-generated authentication system, verify four things:

  • Is the user’s email verified? Unverified sign-ups let attackers register accounts under addresses they don’t own.
  • Are login attempts rate-limited? Without limits, credentials can be brute-forced or stuffed at machine speed.
  • Are passwords hashed with Argon2, bcrypt, or scrypt? Fast hashes, plain hashes, or worse, plaintext, all fall the moment the database leaks.
  • Are password-reset tokens random, short-lived, and single-use? Predictable or reusable reset links are a standing account-takeover path.

AI can generate functional code without implementing any of this. “Functional” and “production-grade” are not the same standard.

2. The error message that leaks your entire user list

One tiny error message can become a security vulnerability. If your application responds differently depending on whether an email exists, attackers can enumerate your registered users one address at a time.

  • ✕  “No account found with this email.”
  • ✕  “This email is already registered.”
  • ✓  “If an account exists, further instructions will be sent.”

Apply the same neutral response everywhere an attacker can probe: login, signup, forgot password, and account recovery. Generic messaging alone isn’t enough, either. Add rate limiting, CAPTCHA or bot detection, and eliminate the response-time differences that quietly reveal whether an account exists. AI coding tools miss all of these unless you ask for them explicitly.

3. The missing rate limit that becomes a bill

A chatbot without user-level rate limits is basically an open meter. Anyone can script thousands of messages, burn through your API credits, and quietly turn your “AI feature” into a cost leak. No breach required, just an unexpected invoice arriving at the end of the month.

The fix is three straightforward controls, none of which the AI adds on its own: visitor-level message limits, a WAF or bot-protection layer, and hard spend caps on the API key.

The Pre-Ship Security Checklist

None of the breaches in this piece required a sophisticated attacker. Every one was preventable with basic engineering hygiene. Run these tiers in order, and finish Tier 1 before a single real user touches the app.

Tier 1: do first, before any real user

  • Keep secrets out of the frontend and your commit history. Any key in client-side JavaScript is readable by anyone with dev tools. Use environment variables, add .env to .gitignore, and proxy third-party calls through a backend.
  • Enable row-level security on every database table. Assume the database is public until you’ve explicitly locked it down, and never let the client enforce access.
  • Enforce authorization on the server, per object. On every request, confirm the logged-in user is allowed to see that specific record. This is what closes IDOR.
  • Harden authentication. Verify emails, rate-limit logins, hash with Argon2, bcrypt, or scrypt, and issue random, short-lived, single-use reset tokens.
  • Rotate any credential that has ever touched a commit, and scan history with a secrets-detection tool.

Tier 2: before scale, payments, or growth

  • Run automated scanning (static and dependency analysis) in your pipeline, and treat AI output as untrusted until reviewed.
  • Add security headers, CSRF protection, and neutral error messages that don’t reveal whether an account exists.
  • Put user-level rate limits, bot detection, and hard API spend caps on anything that costs money per request.
  • Have a human security-review any code you didn’t write and didn’t fully reason through. This is the new skill gap.

Tier 3: ongoing hygiene

  • Monitor for anomalous access patterns such as bulk enumeration and ID-sweeping, which signal probing.
  • Set a policy for sanctioned AI tools, and forbid pasting sensitive data into unapproved ones.
  • Adopt an “assume breach” posture. Credentials will leak, so limit blast radius with least-privilege scopes and fast revocation.

How to Close the Exposure Gap

The checklist above fixes the code, and that part is squarely the developer’s job. But an insecure vibe-coded app doesn’t just risk its own database. It hands attackers working credentials, a customer list, and a brand worth impersonating. That downstream exposure lives outside your perimeter, and no amount of code review reaches it.

This is where the line between a security problem and a fraud problem stops meaning anything. The stolen API key is a cyber incident. The lookalike domain built with the customer data that key unlocked is a fraud incident. Same attacker, same campaign, different surface. Treating those as separate tickets in separate tools is how organizations end up fighting the same adversary twice and losing both times.

Closing the gap means watching the exposure a leaky app creates, not just the app itself.

  • Dark web and credential monitoring. When hardcoded API keys and secrets leak out of a repo or a running app, they surface for sale and reuse. Continuous scanning of dark web and public sources for exposed credentials tied to your brand means a leak gets caught before an attacker weaponizes it.
  • App store and fake-app monitoring. Vibe-coded apps get cloned, repackaged, and spoofed. Monitoring app stores for impersonated and fraudulent versions of your app means takedowns happen before customers download the wrong one.
  • Domain monitoring and automated takedowns. Data skimmed from a leaky app is fuel for phishing. Detecting lookalike domains, typosquats, and spoofed sites that impersonate your brand, then removing them quickly, closes the loop.
  • External attack-surface visibility. You can’t protect what you can’t see. A continuous view of the brand assets, credentials, and infrastructure exposed across the open web keeps a rushed launch from becoming a silent, standing liability.

Bolster AI connects those signals in one place, so a leaked credential, a spoofed app, and a phishing domain read as one coordinated campaign instead of three unrelated alerts. Detection and takedown run on AI at machine speed, with human analysts in the loop for the edge cases and complex threats that deserve a second set of eyes.

A devastating breach rarely starts with a mastermind cracking the mainframe. In 2026, it starts with an app that worked perfectly in the demo and trusted anyone who asked. Secure the code before you ship, then watch the exposure that follows.

See what your brand is already exposing. Request a Bolster AI demo.

This article draws on published industry research, academic studies, and documented breach reports from 2025 and 2026. Figures are rounded and reflect reporting available at the time of writing. Some breach details rely on third-party analysis rather than confirmation by the affected organizations.