Fixes for AI-built apps
The production issues AI coding tools keep shipping, with detection steps and ready-to-copy fixes. Every finding links to the glossary and the blog posts that explain it in depth.
Security
Auth Check Only in Client Code
The auth gate runs only in a client component (useEffect redirect or conditional render), which an attacker bypasses by disabling JavaScript or hitting the API route directly.
IDOR Vulnerability on REST Endpoint
A REST endpoint returns resources by id without verifying the caller owns that resource. Any authenticated user can access any other user's data by changing the id in the URL.
Missing Row Level Security on Supabase Table
A public Supabase table has RLS disabled or has an overly permissive policy, meaning any authenticated user can read or modify every row regardless of ownership.
Secret API Key Exposed in Client Bundle
A sensitive credential (Stripe secret, OpenAI API key, Supabase service role key) is prefixed with NEXT_PUBLIC_, causing it to be inlined into the browser JavaScript bundle where anyone can read it.
Unverified Stripe Webhook
The Stripe webhook endpoint accepts any POST without verifying the signature header, allowing an attacker to forge subscription events, credit accounts, or cancel subscriptions.
Missing Input Validation on API Route
A POST or PATCH API route spreads the raw request body into a database write without validating that fields exist, match expected types, or lie within expected ranges.
No Rate Limiting on Sensitive Endpoints
Authentication, OTP, password reset, and LLM proxy endpoints accept unlimited requests per user, enabling brute force, quota exhaustion, and runaway costs.
Missing Security Headers
The app ships no security response headers, leaving it vulnerable to clickjacking, mixed content, MIME sniffing attacks, and cross-site scripting injection.
Open CORS Policy
An API route sets Access-Control-Allow-Origin to * on routes that accept credentials, allowing any origin on the internet to call your API in a user's browser.
LLM Endpoint Vulnerable to Prompt Injection
A route sends user input to an LLM without isolating it from system-level instructions, letting attackers override the model's behavior, exfiltrate system prompts, or trigger tool calls.
Stability
Missing Error Boundary
No error boundary exists, so a single component error unmounts the entire app and leaves users on a blank white screen with no recovery path.
Hydration Mismatch in SSR Component
A React component renders different markup on the server than on the client, typically because it reads time, randomness, or browser APIs during initial render.