In short
Vibe-coded apps get hacked mainly because the AI builds what you can see and what you asked for, while attacks use what you cannot see. The usual causes are missing database access rules, permissions enforced only in the browser, exposed secrets, unverified webhooks and no rate limits. Because many apps share the same generated patterns, one technique works on all of them.
An attacker does not use your interface
Here is the mental shift. When you test your app, you click buttons. An attacker reads the requests those buttons send, and then sends their own. Every assumption that lives only in the interface, such as a hidden menu or a disabled field, stops existing at that moment.
AI builders are shaped by the prompts they receive, and the prompts describe what users should see and do. Hardly anybody prompts, “And make sure a stranger can't query this table directly.” The result often appears finished, while its most important property has never been specified.
The five patterns
1. Direct database access with weak rules. Many generated apps let the browser talk straight to the database, using a public key that is designed to be visible. This is a legitimate architecture, as long as database rules restrict each user to their own data. Supabase's docs state that a table in an exposed schema without RLS is readable and writable by any role with a grant. CVE-2025-48757 described exactly this class of failure in Lovable-generated projects. Sometimes the rule exists but is effectively “anyone may read”, which scanners that check only for a policy's existence can miss.
2. Authorisation only in the front end. The dashboard hides the admin button, but the server endpoint accepts anyone's request. Or an endpoint checks that you are logged in, but not that the invoice you asked for is yours. This second problem, broken object-level access, is hard to spot in a demo, because you only ever load your own data.
3. Secrets in the wrong place. A key pasted into a prompt can end up in client code, where anyone can read it. Keys can also linger in Git history long after they are deleted from the latest version. Supabase's secret keys bypass every RLS policy, and an exposed AI or payment key can translate straight into a bill. See how to find exposed API keys in your front-end bundle.
4. Trusting the client about money. A success page that grants access, or a webhook that doesn't verify signatures, lets someone unlock a paid feature without paying. Sometimes the price itself is sent from the browser.
5. No limits on abuse. With no rate limits, attackers can test passwords, send email through your account or burn your AI budget. It might not look like a breach, but it can cost more than some breaches do.
Why normal testing does not catch this
Generated tests tend to confirm that the feature works, and they share the same assumptions as the code. Veracode's October 2026 testing reported that about 38% of AI coding tasks still produced vulnerable code, while its earlier report observed that models almost always produce code that compiles. Working and safe are measured by different tests.
There is also a human factor. Finished-looking software creates confidence. Someone who has built an app for the first time may not know that there's a whole category of problem they have not seen yet, so they have no reason to ask about it.
Why attackers find them so fast
- Shared patterns. Thousands of apps come from a few tools, with similar stacks, file names and URLs. A technique that works on one will often work on many.
- Discoverability. Public hosting subdomains and launch posts make such apps easy to list, and scanning is cheap.
- Visible configuration. With a client-side app, the database URL and public key are in the page by design, so the attacker can start testing rules immediately.
- AI helps attackers as well. Writing a script to probe an API takes minutes.
You do not need to be a famous target. This kind of scanning is automated, so being small provides little protection.
The platforms are improving, but it is still your app
Builders now ship scanners. Lovable's Security Center reviews database rules at publish and offers a deeper code review. That's real progress, and you should use these tools. But Lovable also says they “cannot guarantee complete security” and that you are responsible for meeting your app's security requirements. A scanner can't know that managers may see salaries but only for their own team. Those are your business rules, and only you can specify them.
What breaks the pattern
Three habits prevent most of the above:
- Test as a stranger and as another user. Use two accounts and no account, and call the API directly. This takes under an hour and catches the most damaging class of bug.
- Move trust to the server. Permissions, prices and payment confirmation should be decided on the server or in database rules, never in the browser.
- Treat every secret as already exposed if it has ever touched client code or a commit. Rotate it.
Our vibe-coded app security checklist covers the full list in priority order.
If you think you have already been breached
Do not delete anything first. Revoke and rotate keys, close the hole, and keep your logs. Then work out what data was reachable, not just what you can prove was taken. If personal data was involved, you may have legal notification duties, and in the EU these can run on a short clock; take advice quickly. What is GDPR in practice? explains the context.
If you want an independent check before launch or after a scare, book a call.
Common questions
Are vibe-coded apps less secure than hand-written ones?
Not automatically, as human developers write vulnerable code too. The difference is that vibe-coded apps may have had no review, and their builders may not know what to check. Reviewed and tested AI-assisted code can be perfectly sound.
Is the Supabase public key a security hole?
No, it is designed to be public. The hole appears when Row Level Security is missing or too permissive, because that key then reaches your data. The secret or service role key is different and must never reach the browser.
How would someone find my small app?
Through automated scanning, public hosting subdomains, launch posts and search engines. Attackers often do not target you specifically. They look for known patterns across many apps at once, so a small audience gives you little protection.
What should I do first if my app was hacked?
Preserve logs, rotate all keys and passwords, and close the access route. Then determine what data was reachable and whether users or regulators must be told. Get professional and legal help promptly if personal data may be involved.