--- name: vibe-security-guard description: "Run a 16-rule pre-launch static security checklist for AI-generated Next.js, Supabase, Stripe, and Node/Python web apps before deployment." category: security risk: safe source: self source_type: self license: MIT license_source: "https://github.com/Tomsabay/vibe-security-guard/blob/e34ffb1c6711b6ac3ae2eb891a8e8a87be5700c9/LICENSE" date_added: "2026-11-29" author: Tomsabay tags: [security, nextjs, supabase, static-analysis, pre-launch] --- # Vibe Security Guard (16-Rule Pre-Launch Checklist) ## Overview AI-assisted web apps scaffolded with coding agents commonly ship with predictable high-severity misconfigurations: secrets exposed via `NEXT_PUBLIC_*`, unauthenticated Next.js Server Actions, disabled Supabase Row-Level Security (RLS), unverified payment webhooks, and permissive CORS wildcards. This skill guides a structured read-only static security audit before production launch. ## When to Use - Auditing an AI-generated or rapidly prototyped Next.js, React, Node.js, Supabase, or Python web app before public launch. - Reviewing PRs that add payment webhooks, auth routes, Server Actions, or environment variables. - Use this for defensive source review of repositories the user authorizes. Keep testing to static inspection. ## Prerequisites - Read access to the project repository (source files, SQL migrations, `.env.example`, and route handlers). - No network access, credentials, or write permissions are required. ## How It Works ### 1. Establish the inputs Identify the repository root and stack (Next.js App Router, Express/FastAPI, Supabase SQL, Stripe/webhook handlers). Never print or log plaintext secret values found during inspection; report only file path, line number, and masked key names. ### 2. Audit across the 16 pre-launch rules Check source files and migrations for: 1. Hardcoded API keys, private keys, or database URLs in tracked files. 2. Sensitive credentials prefixed with `NEXT_PUBLIC_` or `VITE_` (leaked to browser bundles). 3. Next.js `"use server"` actions mutating database/billing state without a session/auth check. 4. Supabase tables created without `ENABLE ROW LEVEL SECURITY` or with overly broad `USING (true)` policies. 5. `SUPABASE_SERVICE_ROLE_KEY` imported inside client components. 6. Payment webhook handlers missing HMAC/signature verification (`stripe.webhooks.constructEvent` or equivalent). 7. Wildcard CORS (`Access-Control-Allow-Origin: *`) paired with credentials. 8. Raw SQL string interpolation (`f"SELECT ... {user_input}"` or template literals). 9. Dangerous execution sinks (`eval`, `new Function`, `subprocess(..., shell=True)` with user input). 10. Missing rate limiting on auth, OTP, or AI completion endpoints. 11. Unvalidated open redirects or SSRF fetch targets. 12. Weak or hardcoded JWT keys, missing token verification, and unchecked issuer, audience or algorithm settings. 13. Debug flags (`DEBUG = True`) or stack traces exposed in production handlers. 14. Missing ownership checks (IDOR) when updating/deleting records by client-supplied `id`. 15. Unbounded file upload sizes or path traversal in upload filenames. 16. Tracked environment files containing secrets and missing ignore rules for local credential files. ### 3. Verify the result Produce a severity-ranked table (`BLOCK_LAUNCH` vs. `WARN`) with exact `file:line`, rule ID, and concrete remediation patch. Never mark a project clear if any `BLOCK_LAUNCH` item remains unresolved. ## Examples ```text User request: Run a pre-launch security check on our Next.js + Supabase checkout app. Inputs: Repository files (`app/actions.ts`, `supabase/migrations/001.sql`, `.env.example`). Expected result (illustrative): Flags `SEC_SERVER_ACTION_NO_AUTH` at `app/actions.ts:14` and `SEC_NEXT_PUBLIC_SECRET` at `lib/stripe.ts:3`, returns `BLOCK_LAUNCH`, and outputs minimal auth-guard and env-rename fixes without printing secret values. ``` ## Limitations - Static pattern review cannot verify deployed cloud IAM policies, network firewalls, or third-party dashboard settings. - Findings require developer confirmation to rule out intentional test fixtures. ## Safety and side effects Read-only static code inspection (`risk: safe`). Performs no edits, network calls, or exploit execution. Never copy or echo plaintext credentials into outputs or commits. ## Sources and related skills - [MIT-licensed upstream reference](https://github.com/Tomsabay/vibe-security-guard/tree/e34ffb1c6711b6ac3ae2eb891a8e8a87be5700c9). This checklist uses local source and synthetic examples.