Skip to content

Instantly share code, notes, and snippets.

@cosjef
Created March 13, 2026 12:50
Show Gist options
  • Select an option

  • Save cosjef/c4885b8f74090aee05ffaaf6c783b282 to your computer and use it in GitHub Desktop.

Select an option

Save cosjef/c4885b8f74090aee05ffaaf6c783b282 to your computer and use it in GitHub Desktop.
Vibe-coding security checklist (B2C Saas)

Expert Security Audit: Vibe-Informed Deployment Checklist (B2C SaaS)

A hybrid of structured security auditing, high-impact threat modeling, and practical developer guidance for consumer-facing SaaS platforms.


1. ANALYSIS PHASE — Full Codebase Review

  • Systematically review: authentication, data flow, API endpoints, environment variables
  • Document each finding with file and line number
  • Prioritize issues by risk impact (e.g., remote code execution > misconfiguration)
  • Identify areas where user data or authentication state crosses trust boundaries

Critical Focus Areas

  • Authentication / Authorization
  • Input validation
  • Exposed secrets
  • IDOR vulnerabilities
  • Rate limiting
  • Unsafe data exposure
  • Error handling
  • Dependency vulnerabilities

2. CRITICAL SECURITY DOMAINS


Authentication & Authorization

  • All sensitive routes require authentication
  • Authorization checks enforce correct permissions
  • No privilege escalation paths
  • Admin routes require authentication and role validation
  • 2FA enabled for all admin accounts
  • Optional 2FA available for users
  • Sessions expire appropriately
  • Tokens rotated periodically
  • Login attempts throttled
  • Account lockout after repeated failures

Account Abuse & Bot Protection

Consumer SaaS platforms are frequent targets of automated abuse.

  • CAPTCHA or bot protection on login
  • CAPTCHA on signup flow
  • Rate limit login attempts
  • Rate limit password reset requests
  • Protection against credential stuffing
  • Temporary IP blocking after repeated failures
  • Device fingerprinting for suspicious behavior
  • Email domain abuse detection
  • Signup anomaly detection

Password & Credential Security

  • Passwords never stored in plaintext
  • Passwords hashed using bcrypt or argon2
  • Password hashing includes salt
  • Password reset tokens expire quickly (≤15 minutes)
  • Password reset tokens single-use
  • Breached password detection (HaveIBeenPwned or similar)
  • Password strength validation

Environment & Secrets Management

  • Environment variables never exposed to client code
  • Secrets stored only in server environment or secret manager
  • No secrets committed to repository
  • Deployment pipelines scrub secrets from logs
  • Production and development environments separated
  • API tokens scoped with least privilege

API Security

  • Rate limiting applied to every API route
  • Authentication required for sensitive endpoints
  • Request body schema validation
  • Server-side validation for all inputs
  • Request size limits enforced
  • Pagination required for large data sets
  • Authentication endpoints stricter rate limits

Input Validation & Data Sanitization

  • Validate all user inputs server-side
  • Sanitize all user input before storing
  • Encode outputs to prevent XSS
  • Parameterized database queries
  • Prevent command injection
  • Prevent path traversal
  • Reject malformed JSON or payloads

Database Security

  • Supabase Row Level Security (RLS) enabled on all tables
  • Database access restricted by role
  • Principle of least privilege applied
  • Sensitive columns encrypted where necessary
  • Query logs enabled
  • Direct database access not exposed publicly

Network & Transport Security

  • HTTPS enforced everywhere
  • HTTP redirects to HTTPS
  • HSTS enabled
  • TLS restricted to modern versions
  • Security headers enabled

Cookie Security

  • Cookies set with HttpOnly
  • Cookies set with Secure
  • SameSite flag configured
  • Session cookies expire appropriately

CORS & Origin Security

  • CORS rules whitelist only trusted domains
  • No wildcard origins (*)
  • Credentials allowed only where necessary
  • Preflight requests validated

Error Handling & Information Leakage

  • Detailed error messages disabled in production
  • Stack traces never exposed to clients
  • Internal file paths hidden
  • Structured error logging implemented
  • User-facing errors sanitized

Dependency & Supply Chain Security

  • Run dependency audits every sprint (npm audit, etc.)
  • Dependency lockfiles committed
  • Outdated libraries reviewed regularly
  • Third-party packages vetted before use
  • Automated dependency alerts enabled

Logging & Monitoring

  • Log every authentication event
  • Log login failures
  • Log suspicious activity
  • Log password reset attempts
  • Log rate limit violations
  • Logs protected from tampering
  • Security alerts monitored

Privacy & Compliance (B2C)

Consumer platforms must support data privacy rights.

  • GDPR data export endpoint
  • GDPR delete account endpoint
  • Data retention policy defined
  • Privacy policy published
  • PII classification documented
  • Data minimization enforced
  • User consent tracking

Email & Account Security

  • Email verification required for signup
  • Notify users of new device login
  • Notify users of password change
  • Prevent disposable email abuse
  • Secure email templates (no secrets)

Abuse Monitoring

  • Alert on unusual signup spikes
  • Alert on abnormal API usage
  • Alert on mass password reset attempts
  • Alert on suspicious geographic login patterns
  • Monitor traffic anomalies

3. PLANNING PHASE — Design Your Fix

For each vulnerability:

  • Describe the exact security risk
  • Show proof or attack vector (curl example, logs, etc.)
  • Outline remediation steps
  • Explain security implications of the fix

4. IMPLEMENTATION PHASE — Surgical Fixes

  • Only modify code relevant to security
  • Document before/after changes
  • Retest affected features
  • Verify no regressions introduced
  • Add additional hardening where appropriate

5. PRE-DEPLOY SECURITY GATE

Before every production deploy:

  • Run automated security audit
  • Verify rate limits active
  • Confirm authentication logging works
  • Confirm RLS policies enforced
  • Validate HTTPS enforcement
  • Run dependency vulnerability scan
  • Validate environment secret configuration

DO NOT

  • Make performance or styling changes
  • Commit unrelated refactors
  • Skip vulnerability analysis
  • Make changes without documenting the reason

After Each Fix

  1. What vulnerability was addressed?
  2. Why was the original code unsafe?
  3. How does the fix mitigate the risk?
  4. What additional hardening should be considered?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment