AI code generators optimize for getting a UI working on screen quickly—which often leaves subtle security gaps underneath. Before deploying a Cursor, Lovable, or Claude Code app to production, verify these 7 failure points:
The 7 Bugs to Check Before Deploying
- Leaked Private Keys in Frontend Env Vars: Check that private API secrets or service-role database keys never get prefixed with
NEXT_PUBLIC_orVITE_. - Missing Resource Ownership Checks (IDOR): Checking
if (!session)is not enough—verifyrecord.userId === session.userIdon every read, update, and delete query. - Trusting Unverified JWT Claims: Always validate the signature and expiration on the server. Use our JWT Token Decoder during debugging to inspect
expand payload claims safely in your browser. - Broken Wildcard CORS Headers: Combining
Access-Control-Allow-Origin: *with credentials breaks browsers or exposes endpoints. Follow our Fix CORS Errors checklist to configure an explicit origin allowlist. - Unparameterized SQL Queries: Bind all query parameters via prepared statements—never build SQL queries with template-literal interpolation.
- Missing Rate Limits on AI/Email Endpoints: Unprotected serverless routes can rack up surprise API bills overnight; rate-limit by IP and user ID cleanly.
- Huge Uncompressed Assets & Poor Core Web Vitals: Convert bulky PNGs with Image to WebP and check Core Web Vitals before launch.
Download the Security Auditor SKILL.md Pack
Install our automated API & Auth audit skill inside Claude Code or Cursor
Frequently Asked Questions
What is the most common bug in AI-generated backends?
Broken object-level authorization—routes check authentication but forget to confirm the logged-in user actually owns the requested database record.
Can client-side JWT decoding verify a token?
No. Decoding Base64Url inspects claims only; cryptographic signature verification must happen server-side with your secret or public key.