Vibe-Coded App Security Fails: 1,764-App Audit Results
1,764 vibe-coded apps exposed: AI-generated security vulnerabilities developers must fix now. Database access, API keys, data breaches—all preventable.
The Audit That Exposed a Pattern Nobody Wanted to See
A startup ships a product in a weekend. The demo looks polished, the onboarding works, investors are impressed. Under the hood, the database has no access controls, API keys sit in the browser console, and any user can download another user's data by changing a number in the URL.
This is not a hypothetical scenario. A large-scale security audit of 1,764 "vibe-coded" applications — apps built primarily or entirely by AI code generators — found these exact vulnerabilities repeated across hundreds of products. The findings paint a picture that anyone building with AI-assisted tools needs to understand before shipping to production.
Put simply: the speed gains from vibe coding come with security costs that most teams are not accounting for.
Real Numbers: What the Audit Actually Found
The headline statistics from the audit are specific enough to act on:
- 7% of all audited apps had wide-open Supabase databases — no Row Level Security (RLS), no access policies, meaning anyone with the API URL could read or write data freely.
- 15% of apps built with Bolt shipped hardcoded API keys — credentials baked directly into client-side code, visible to anyone who opens browser developer tools.
- IDOR (Insecure Direct Object Reference) vulnerabilities and zero-authentication API endpoints appeared repeatedly across the sample.
These numbers come from a review that spanned apps built with multiple AI tools, including Claude Code, Codex, Cursor, Replit, and Devin. According to Wiz's security research, an August 2025 report found that 45% of AI-generated code ships with security vulnerabilities. More than 7 out of 10 instances of LLM-generated Java code had vulnerabilities, while JavaScript, Python, and C# averaged around 40%.
Separate research covered by CodeWithSeb found that Lovable, the AI app builder, had 170 of 1,645 scanned applications exposing user data publicly. The vibe-coded social platform Moltbook leaked 1.5 million authentication tokens because nobody audited what the AI had built.
Real numbers: A focused test of 15 apps built with popular AI coding tools found 69 vulnerabilities. The broader research pattern shows AI-generated code contains roughly 2.74 times more security flaws than human-written code, according to the Forbes report. GitHub Copilot now writes approximately 46% of the average developer's code, which means nearly half of all new code entering production faces these elevated risk levels.
The 83% Problem: Code That Works Is Not Code That Is Secure
One of the most useful data points from this wave of research separates two questions that teams often conflate: "Does it work?" and "Is it secure?"
The answer is jarring. Research cited on LinkedIn found that while 61% of AI-generated solutions functioned correctly, only 10.5% were actually secure. That produces an 83% failure rate on code that appears to work fine — code that passes manual testing, demos well, and handles the happy path without issues.
This gap is the core danger of vibe coding. The feedback loop is broken. When a developer writes code manually, they encounter friction — they have to think about database permissions, authentication flows, input validation. AI code generators skip that friction. They produce working features and skip the security scaffolding.
As Retool's analysis puts it, this creates "automation complacency" — when a system consistently produces correct outputs, humans stop checking its work carefully. The AI has been right about functionality so many times that nobody looks for what it might have gotten wrong about security.
Wide-Open Databases: What "No Access Controls" Actually Means
The 7% figure for wide-open Supabase databases deserves unpacking, because the business consequences are severe.
Supabase provides auto-generated Data APIs that let frontend code talk directly to the database. This is a deliberate design choice that speeds up development — no need to build separate backend services. But this architecture requires Row Level Security (RLS) policies to be in place. Without them, the frontend API key effectively grants unrestricted access to every row in every table.
According to Supabase's own documentation, the anon key is safe to expose only with RLS enabled, because row access permissions are checked against access policies and the user's JWT token. Without RLS, that safe-to-expose key becomes a skeleton key.
Here is what happens when an AI code generator builds a Supabase application:
- It creates the database tables.
- It generates the frontend CRUD operations.
- It connects them through the Supabase client with the anon key.
- It does not generate RLS policies, or generates them incorrectly.
The result: a working application where any user — or any attacker — can query any table and retrieve all data. No authentication bypass needed. The door was never locked.
The Service Role Key Exposure
A related but even more dangerous pattern: the service role key appearing in frontend code. Supabase's documentation is explicit — this key bypasses RLS entirely and should never appear on the client side. It should be treated as a secret, imported as an environment variable, never hardcoded.
AI code generators frequently ignore this distinction. They see that the service role key makes API calls work without permission errors, so they use it. The generated code works. It also grants every visitor full administrative access to the database.
Honest take: the Supabase architecture is powerful, but it requires developers to understand the security model. AI tools generate code that uses the APIs without understanding the model. The 7% figure likely undercounts the problem, because it only captures databases with zero RLS — not databases with incorrectly configured or overly permissive policies.
Hardcoded API Keys: $200 a Month Anyone Could Steal
The 15% rate of hardcoded API keys in Bolt-generated applications is alarming because of what those keys unlock.
Security auditors found OpenAI API keys visible in browser consoles. Stripe payment processing secrets fully exposed. The research described one case with $200 per month in API keys that anyone could extract and use. That is not just a security vulnerability — it is direct, ongoing financial exposure.
The pattern repeats because AI code generators optimize for the simplest path to a working feature. Need to call the OpenAI API from the frontend? The simplest path is to put the key in the JavaScript code. Need Stripe integration? Embed the secret key. The feature works immediately. The key is also immediately available to every visitor.
Why This Keeps Happening
Three factors combine to make hardcoded keys a default pattern in AI-generated code:
First, AI models are trained on vast amounts of code, including tutorials, demos, and example projects where hardcoded keys are normal. Tutorial code optimizes for clarity, not security. The model reproduces what it has seen most often.
Second, environment variable management requires infrastructure setup — .env files, server-side rendering or API routes, deployment configuration. AI code generators that focus on rapid prototyping often skip infrastructure concerns entirely.
Third, the generated code works with the key hardcoded. There is no error, no warning, no failed test. The only signal that something is wrong comes from a security review — which, as the audit demonstrates, most vibe-coded apps never receive.
IDOR and Zero-Auth: The Vulnerabilities That Give Away Everything
IDOR — Insecure Direct Object Reference — is a vulnerability where changing an identifier in a request gives access to another user's data. Think of it as apartment mailboxes with no locks: change the number, open any box.
The audit found this pattern across vibe-coded applications. One documented case allowed anyone to download the entire customer database — names, emails, credit balances — by changing a single number in the URL. No authentication required. No authorization check. Just increment the ID.
This happens because AI code generators build CRUD operations using sequential numeric IDs and skip authorization middleware. The generated API endpoints serve data to whoever asks, with no verification that the requesting user has permission to access that specific resource.
Zero-auth APIs compound the problem. Auditors found:
- REST endpoints with no authentication check at all — any HTTP request receives a response.
- Admin routes protected only by a client-side
isAdminflag — trivially bypassed by modifying the request. - File upload handlers accepting any file type to publicly accessible S3 buckets — opening the door to malicious file hosting or data exfiltration.
- XSS vulnerabilities where malicious scripts hidden in links could steal admin credentials when clicked.
- Header injection enabling cache poisoning and cookie forgery.
What this means for your project: every API endpoint in a vibe-coded application needs manual review for authentication and authorization. The AI generates the happy path — authenticated user requests their own data — but does not generate the security boundaries that prevent the unhappy path.
Why AI Code Generators Consistently Produce Insecure Output
Understanding the root cause helps teams allocate their security budgets correctly.
AI code generators are language models. They predict the most likely next token based on training data. Security patterns — input validation, parameterized queries, proper authentication flows, RLS policies — are less frequent in training data than the basic CRUD patterns they protect against. The model produces what it has seen most, which is functional code without security layers.
The 2.74x multiplier on security flaws compared to human-written code reflects this statistical tendency. A human developer with security awareness writes a database query and thinks about SQL injection. An AI writes the query that works and moves on.
Enterprise environments amplify every one of these risks. As Retool notes, more users, more sensitive data, and more regulatory obligations mean the consequences of a vulnerability are far greater. A wide-open database in a weekend project is embarrassing. A wide-open database in a product handling payment data or health records is a regulatory violation with six-figure fines.
How to Audit Vibe-Coded Apps Before They Ship
The security gap is real, but it is also fixable. The key is accepting that AI-generated code requires a different review process than human-written code.
Step 1: Scan for Hardcoded Secrets
Before any deployment, search the entire codebase for API keys, tokens, and credentials. Tools like git-secrets, truffleHog, or gitleaks automate this process. Pay special attention to:
- Any string that looks like an API key in JavaScript or TypeScript files
- Environment variables referenced with fallback values (the fallback is often the real key)
- Configuration files that made it into the repository
Step 2: Verify Database Access Controls
For Supabase projects specifically:
- Confirm RLS is enabled on every table that holds user data.
- Review each RLS policy — an overly permissive policy (e.g.,
truefor all operations) is functionally equivalent to no policy. - Verify the service role key never appears in frontend code. Search for it explicitly.
- Test with the anon key from an unauthenticated context to confirm you cannot access protected data.
Step 3: Test Every API Endpoint for Authentication and Authorization
- List all API routes in the application.
- Call each route without an authentication token. Any route that returns data without auth needs investigation.
- Call each route with a valid token for User A, requesting User B's data. Any route that serves another user's data has an IDOR vulnerability.
- Check that admin-only functionality verifies permissions server-side, not through client-side flags.
Step 4: Review Input Handling
- Check that database queries use parameterized statements, not string concatenation.
- Verify that file uploads validate file types and sizes server-side.
- Confirm that user input displayed in the UI is properly escaped to prevent XSS.
Step 5: Use AI as a Security Reviewer
Interestingly, the same AI tools that generate insecure code can help find vulnerabilities when prompted differently. Asking an AI to review code specifically for OWASP Top 10 vulnerabilities, or prompting it to "think like a penetration tester," can surface issues that the generation step missed. This is not a substitute for professional security review, but it catches low-hanging fruit.
Here is what we recommend: treat every vibe-coded application as untrusted code until proven otherwise. Budget for a security review proportional to the sensitivity of the data involved. For MVPs with no real user data, an automated scan and manual endpoint review may suffice. For applications handling payments, personal data, or health information, a professional penetration test is the minimum responsible step.
Key Takeaway for Business
Three conclusions from this audit data:
First, vibe coding delivers genuine speed advantages, but teams must budget security review time into the development cycle. An application built in a weekend still needs a day of security review before it touches real user data. Skipping this step is not saving time — it is borrowing against a future incident.
Second, the vulnerabilities found are not exotic or difficult to exploit. Open databases, hardcoded keys, and IDOR flaws are entry-level attack vectors. They do not require sophisticated tooling or deep technical knowledge. A curious user with browser developer tools can find and exploit most of them.
Third, the 24.7% vulnerability rate in AI-generated code (roughly 1.5 to 2 times the human-written rate, according to CodeWithSeb's analysis) is not a reason to stop using AI coding tools. It is a reason to build security checks into the workflow rather than treating them as optional. The speed benefits are real. The risks are also real. Managing both is the job.
Frequently Asked Questions
Why do AI code generators leave Supabase databases completely open without access controls?
AI models generate the most statistically common code patterns from their training data. Creating tables and CRUD operations is common in tutorials and examples; writing Row Level Security policies is not. The model produces working data access and skips the security layer because it was underrepresented in training data. Supabase's architecture requires RLS to be explicitly enabled and configured — there is no safe default that the AI can fall back on.
What is the fastest way to scan for hardcoded API keys before deploying vibe-coded apps?
Run gitleaks or truffleHog against the repository — both tools scan for patterns matching known API key formats and flag them in seconds. For an extra layer, search the codebase for common key prefixes like sk-, pk_live_, eyJ, and any 32+ character alphanumeric strings in frontend JavaScript files. Automated scanning catches the majority of exposed secrets before they reach production.
How do I verify that switching from sequential IDs to UUIDs actually prevents IDOR vulnerabilities?
UUIDs make IDOR harder by removing predictability — an attacker cannot simply increment a number to access another record. However, UUIDs alone are not a fix. Proper authorization checks must verify that the requesting user has permission to access the specific resource, regardless of ID format. Test by making API requests with a valid session for one user while targeting another user's UUID. If the request succeeds, authorization is still missing.
Can prompting an AI tool to "think like a hacker" actually surface real vulnerabilities in vibe-coded apps?
Yes, but with caveats. Prompting AI models to review code for OWASP Top 10 vulnerabilities or act as a penetration tester can catch common issues like missing authentication, exposed keys, and SQL injection patterns. Research shows this approach finds a significant portion of low-hanging security flaws. However, it should supplement — not replace — structured security testing, because AI reviewers can miss logic flaws, race conditions, and complex authorization bypasses that require understanding the full application context.
How do I test whether my authentication is broken on the client side vs. the server side?
Open your browser's developer tools, find the API requests your application makes, and replay them using a tool like curl or Postman — but remove or modify the authentication headers. If the API still returns data, authentication is only enforced on the client side (or not enforced at all). Server-side authentication means the API itself rejects unauthenticated requests with a 401 or 403 status code, regardless of what the frontend does.
This article is based on publicly available sources and may contain inaccuracies.


