Cursor Pre-Launch Playbook
Cursor + Next.js Pre-Launch Security Checklist
Catch the exact mistakes Cursor Composer introduces in Next.js App Router apps: unprotected POST routes, $queryRawUnsafe SQL injection, and NEXT_PUBLIC_ secret leaks.
Top Production Landmines in Cursor Apps
CRITICAL
Unauthenticated POST / PUT / DELETE routes in app/api/
Cursor frequently scaffolds working API routes without calling supabase.auth.getUser() or auth().
Fix: Verify user session at line 1 of every mutating route handler and return HTTP 401.
CRITICAL
IDOR in dynamic route handlers (/api/items/[id])
Querying where: { id: params.id } without filtering by user_id lets users edit other tenants' data.
Fix: Scope every query by BOTH id AND authenticated user_id.
CRITICAL
Prisma $queryRawUnsafe with template string interpolation
Direct string interpolation opens full SQL injection.
Fix: Replace $queryRawUnsafe with parameterized $queryRaw tagged templates.
HIGH
Hallucinated / unpinned npm packages in package.json
AI suggestions can introduce unregistered slopsquatted packages.
Fix: Verify every package on npm and pin versions cleanly.
Copy-Paste Cursor Pre-Launch Audit Prompt
Review every route in app/api/: enforce server-side auth checks on all mutations, scope DB queries by user_id, replace any $queryRawUnsafe calls with parameterized queries, and verify no secret uses NEXT_PUBLIC_.