Vibe Coding & AI App Security Guides
Every guide includes why AI coding assistants introduce the bug, side-by-side vulnerable vs. fixed code, a copy-paste AI Fix Prompt for Cursor/Lovable/Claude Code, and exact verification steps.
AI Builders & Stacks (9)
The Production Vibe Coding Security Checklist
AI coding tools optimize for getting a demo working in 60 seconds, not locking down multi-tenant authorization, rate limits, or secret boundaries. This checklist covers the 12 failures that cause 90% of indie SaaS breaches.
Copy-Paste Vibe Coding Security Audit Prompt
Asking an AI coding assistant 'is my app secure?' produces vague platitudes. Giving it a structured, threat-modeled security prompt forces it to inspect exact file boundaries, SQL policies, and auth checks.
Top 6 Lovable Security Issues (And Exact Fixes)
Lovable builds gorgeous Vite + React + Supabase apps in minutes, which means nearly all application logic initially runs inside the browser. Anything shipped in Vite client bundles is 100% visible to users.
Bolt.new App Security Hardening Guide
Bolt.new lets you scaffold and deploy full-stack apps to Netlify in minutes, but default Vite templates ship public sourcemaps, wide-open CORS headers on helper functions, and unhardened database tables.
Securing Cursor-Built Next.js 15 Apps
Cursor Composer excels at building Next.js App Router SaaS apps, but App Router introduces subtle security traps: unauthenticated Server Actions, accidentally importing server secrets into 'use client' trees, and trusting middleware alone.
Hardening v0-Generated Next.js Apps
Vercel's v0 generates polished UI components and starter routes rapidly, but prototype patterns like localStorage 'auth flags', permissive AI chat routes, and unsanitized HTML rendering must be replaced before taking real users.
Hardening Your Vercel Production Deployment
Vercel makes deploying effortless, which also means a leaked preview URL, mis-scoped production environment variable, or unthrottled serverless route can expose staging data or trigger unexpected usage spikes.
15-Minute SaaS Pre-Launch Security Audit
Launch day brings sudden traffic spikes — and opportunistic security researchers or bots probing your brand-new app. Fifteen minutes of structured verification prevents an embarrassing launch-day incident.
The 8 Most Common AI-Generated Code Vulnerabilities
LLMs trained on millions of StackOverflow snippets and hackathon repos systematically repeat the same 8 security anti-patterns unless explicitly constrained.
Supabase & Databases (4)
How to Fix 'Supabase RLS Disabled in Public'
When Supabase flags 'RLS Disabled in Public', any person on the internet who grabs your public project URL and anon key from DevTools can read, edit, or wipe every single row in that table via PostgREST.
Production Supabase RLS Policies Cheat Sheet
Turning on RLS isn't enough if you attach a lazy USING (true) policy. Secure SaaS apps separate read-only billing rows, per-user CRUD tables, workspace memberships, and insert-only lead forms.
Fixing a Leaked Supabase Service Role Key
Even if you wrote perfect PostgreSQL RLS policies, putting SUPABASE_SERVICE_ROLE_KEY inside a browser bundle or NEXT_PUBLIC_ variable gives attackers god-mode admin access to your entire database and Auth user list.
Fixing Open Firebase Firestore Security Rules
Just like Supabase RLS, Firebase's apiKey is intentionally public — your entire database security depends on Firestore & Storage Security Rules. Shipping test-mode rules leaves every document world-readable and writable.
Secrets & Exposure (4)
How to Fix Exposed /.env and /.git Files
Automated bots continuously scan every new domain on the internet for /.env and /.git/HEAD within minutes of SSL certificate issuance. If your server returns your .env file, assume every credential inside is already stolen.
Fixing a Leaked Stripe Secret Key (sk_live_)
A Stripe secret key (sk_live_*) grants full API control over your Stripe account: reading customer PII, issuing refunds, creating payouts, and modifying subscriptions. It must NEVER appear in browser JavaScript.
Fixing Leaked OpenAI / Anthropic Keys in Client Code
Exposing an OpenAI (sk-proj-*) or Anthropic API key in frontend JavaScript is the fastest way to wake up to a $1,000+ overnight bill. Bots scrape newly deployed SPAs specifically hunting for LLM keys.
Why Public JS SourceMaps Leak Your SaaS Logic
Production JavaScript sourcemaps reconstruct your exact original folder structure, TypeScript comments, prompt templates, and hidden admin route URLs straight inside Chrome DevTools.
Headers, Auth & APIs (7)
Production Next.js 15 Security Headers Setup
A fresh Next.js project ships with zero Content-Security-Policy, no X-Frame-Options, no nosniff, and an X-Powered-By: Next.js header. Adding 25 lines to next.config.ts instantly hardens your browser attack surface.
Fixing Permissive CORS Misconfigurations
Permissive CORS policies — especially reflecting arbitrary Origin headers alongside Access-Control-Allow-Credentials: true — allow malicious third-party websites to make authenticated requests on behalf of your logged-in users.
Securing Cloudflare Workers, D1 & Pages Apps
Cloudflare Workers give indie SaaS apps blazing speed and generous free tiers, but common AI mistakes — string-interpolated D1 SQL queries, committing secrets into wrangler.jsonc vars, and open fetch proxies — can compromise your edge stack.
Fixing Auth Bypass Risks in Next.js Middleware
Relying exclusively on middleware.ts as a perimeter wall leaves your routes exposed whenever a matcher regex misses a path or a framework bug bypasses middleware execution (like CVE-2025-29927 in older Next.js builds).
Rate Limiting AI, Auth & Email Endpoints
Every public AI wrapper, waitlist endpoint, or magic-link login route without rate limiting is a ticking financial bomb. One automated script can send 50,000 requests overnight.
Preventing SSRF in URL Fetchers & Scanners
Any backend route that takes a user-supplied URL and calls `fetch(url)` is vulnerable to SSRF — allowing attackers to probe internal admin panels, localhost Redis/Postgres ports, or cloud metadata endpoints (`169.254.169.254`).
Verifying Stripe & Payment Webhook Signatures
Your `/api/webhooks/stripe` endpoint is publicly reachable without a user login cookie. If you parse `req.json()` without cryptographically verifying the webhook signature on the raw request body, anyone can forge a payment event in 5 seconds.
VibeSecCheck Free Live Audit
Want to know which of these issues your live app actually has?
Run our 12-point passive URL security scan or generate production Supabase RLS SQL policies in 10 seconds with zero signup.
Scan My Live App Free