S8.10
Vibe Coding Security: What Breaks and How to Fix It
The short answer
TL;DR
- →AI coding tools build what you ask for, they do not audit security by default
- →The most common gaps are: missing row-level security, exposed API keys and unchecked auth on routes
- →These are fixable, but you have to ask for them explicitly
- →Supabase row-level security is the most important thing to get right for any app with user data
- →A one-hour developer review before launch is worth it if you are handling payments or private data
Why Do Vibe Coded Apps Have Security Problems?
AI coding tools generate code fast. That speed is the whole point. But they respond to prompts. They build the feature you described. They do not pause to ask "what happens if an authenticated user tries to access another user's data?" unless you raise it.
That is not a flaw in the tools. It is just how they work. Security is a layer you add deliberately. Here is what to add and how to check it.
Part of the vibe coding hub.
What Are the Most Common Vibe Coding Security Gaps?
Row-level security missing in Supabase. This is the biggest one. Supabase uses Postgres with a client library that runs in the browser. If you do not add row-level security policies, any logged-in user can query any row in any table. That means User A can read User B's records. Lovable does not always add RLS by default. Check it every time.
To fix: go to your Supabase dashboard, open the Table Editor, and check the RLS toggle for every table. Then open the Policies section and confirm the policies match what you intend. Ask Claude Code or Lovable to audit your RLS setup if you are not sure.
API keys in the front-end.
If an API key gets hardcoded into a React component, it is visible to anyone who opens browser developer tools. The fix is environment variables. Every secret key goes in a .env file, not in a component.
Ask the AI: "Check the codebase for any hardcoded API keys or secrets and move them to environment variables."
Unprotected routes. Routes that should require login sometimes do not get protected properly. A user who knows the URL can access the page directly without logging in. Test every route by navigating to it directly in a private browser window without logging in.
No rate limiting. Forms with no rate limiting can be abused. A login form with no limits is vulnerable to brute-force attacks. Ask the AI to add rate limiting to auth endpoints. Supabase Auth has built-in rate limiting you can configure.
Insecure file uploads. If your app lets users upload files, check that there is a file type restriction and a size limit. An upload endpoint with no restrictions can be abused.
How Do You Check Your App's Security Before Launch?
Run through this checklist manually before you go live:
- Log in as User A. Access a record URL belonging to User B directly. Confirm it is blocked.
- Open browser developer tools on any page. Search for API keys or secrets in the source. There should be none.
- Open every protected page URL without being logged in. Confirm all redirect to login.
- Check every Supabase table has RLS enabled and at least one policy.
- Check every form for a file upload and confirm file type and size limits exist.
- Try submitting a login form 20 times rapidly. Confirm it slows down or blocks.
This takes about an hour. For apps handling payments or private user data, follow this with a review from a developer. One hour of their time is much cheaper than a data breach.
The vibe coded prototype to production post has a broader hardening checklist for everything else beyond security.
If you want the security review done for you as part of a full build, Devwiz handles it as standard.
Frequently Asked Questions
- Can a vibe coded app ever be truly secure?
- Yes. The underlying tools, Supabase and React, are used in production apps handling sensitive data every day. The security comes from configuration, not the stack. You need to configure it correctly.
- What is the biggest security risk in a vibe coded Supabase app?
- Missing row-level security policies. Without them, any authenticated user can query any row in any table using the Supabase client. This exposes all user data to all users.
- Should I get a security audit before launching a vibe coded app?
- If you are handling health data, financial data or payment details, yes. For a simple tool or internal app, a manual review of the checklist in this post is enough to cover the common gaps.
Related Services