Common security mistakes in AI-built apps that get them hacked.
AI builders make shipping fast. They also make the same few security mistakes over and over. Here are the ones to check before launch.
1. Secret keys in frontend code
AI tools happily paste an OpenAI or Stripe secret into a React component to “make it work”. Ask the AI explicitly to move the call to a server function. Leaked-key stories →
2. Database open without login
Supabase/Firebase tables without Row Level Security or rules can be read by anyone holding the public key — which is everyone. 16,000+ Supabase databases exposed →
3. App left public by default
Researchers found thousands of vibe-coded apps reachable by anyone with the URL, some indexed by search engines (see sources on our Trends page). Check your platform’s visibility setting. Sources on Trends →
4. Fake authentication
Hiding a page behind a client-side check is not security. Data must be protected on the server/database, not just hidden in the UI. Lovable-hosted app exposed 18,697 records →
5. Exposed .env and .git
Misconfigured hosting can serve your environment file or git folder directly. Open yourdomain/.env and yourdomain/.git/config in a browser: both should return an error, never a file.
6. No security headers
Missing CSP, HSTS and X-Frame-Options make XSS and clickjacking easier. Most hosts let you add them in one config file; ask your AI tool to add them and explain each one.
7. Trusting untrusted repos and MCP configs
Opening an untrusted project in an AI coding agent can run its config. Check Point disclosed (now patched) Claude Code issues where project files could exfiltrate API keys. The Claude Code project-files story →
8. Never rotating
Leaked keys often stay valid for years. Rotate after any suspected exposure. GitGuardian data on Trends →
A 15-minute pre-launch check
- Log out and try to open a private page directly. Then create a second account and try to read the first account's data.
- Search your built JavaScript and your repository for secret key prefixes. See how to protect API keys.
- In Supabase or Firebase, confirm every table or collection has row-level security or rules, and test them without logging in. See open database rules.
- Check your platform's visibility setting, so a preview or internal app is not public.
- Run one real payment and one failed payment end to end. See payments and webhooks.
- Set spend limits on every AI and cloud provider you use.
Why AI tools keep making these mistakes
AI coding tools optimise for code that works in the demo. A key pasted into the frontend works. A table without row-level security works. A page hidden by a client-side check works. Nothing fails until someone else looks. That is why it helps to ask for security explicitly: tell the tool which data is private, ask it to explain how access is enforced on the server, and review the answer before you accept the change. Every story on ShipSafe ends with a fix prompt written for exactly this.