Security Implementation

Technical documentation of actual security measures implemented in the Succedence platform. No marketing claims—just the code-level protections in place.

Authentication & Session Management

Supabase Auth

Primary authentication layer using Supabase Auth service with email/password and OAuth providers.

Implementation: /middleware.ts, /lib/supabase/client.ts

Session Handling

  • Token storage: Supabase Auth tokens stored in HTTP-only cookies (not localStorage)
  • Server-side validation: Middleware validates session on every protected route request
  • Service role key: Admin operations use separate service role key with elevated privileges
  • Anon key: User-level API calls use anonymous key with row-level security enforcement

Route Protection

Public Routes (No Auth Required)
  • / (homepage)
  • /valuation (free tool)
  • /pricing
  • /how-it-works
  • /brokers
  • /blog/*
Protected Routes (Auth Required)
  • /dashboard
  • /profile
  • /preferences
  • /matches
  • /saved-listings
  • /listings/*/edit
  • /admin (email whitelist)

Authorization & Role-Based Access Control

User Roles

Buyer

  • • Browse listings
  • • Save favorites
  • • Receive matches
  • • Contact sellers

Seller

  • • Create listings
  • • Edit own listings
  • • View inquiries
  • • Respond to buyers

Broker

  • • All seller permissions
  • • Public profile
  • • Client management
  • • Bulk operations

Admin

  • • User management
  • • Listing moderation
  • • Usage analytics
  • • Plan changes
  • • Import tools

Admin Access Control

Admin routes protected by hardcoded email whitelist in middleware:

const ADMIN_EMAILS = ['evank8029@gmail.com', 'succedence@gmail.com']

Location: /middleware.ts:25-28

API Security & Rate Limiting

Plan-Based Usage Enforcement

All AI and analysis endpoints enforce quota limits based on user plan. Violations are logged to database with IP address and user agent.

Implementation: /lib/middleware/usage-security.ts

Security Checks

  • IP address logging: Captures x-forwarded-for and x-real-ip headers for audit trail
  • User agent tracking: Records client type for abuse detection
  • Authentication verification: Validates Supabase session before quota checks
  • Plan-based access control: Rejects requests exceeding plan limits with 429 status
  • Usage violation logging: All limit-exceeded events stored in usage_violations table

Cron Job Protection

Background jobs (nightly matching, digest emails) protected by secret header:

Header Required: x-cron-secret: [CRON_SECRET]
Endpoints Protected:
  • /api/match/run (nightly matching engine)
  • /api/cron/daily-tasks (batch operations)
  • /api/cron/upgrade-expired-trials (plan management)

Development bypass: DEV_BYPASS_AUTH=true (development only, not in production)

HTTP Security Headers

X-Content-Type-Options
Prevents MIME type sniffing
X-Frame-Options
Prevents clickjacking attacks
X-XSS-Protection
Browser XSS filtering enabled
Strict-Transport-Security
HTTPS enforcement (planned)

Data Protection & Privacy

Database Security

  • Supabase Row-Level Security: Database-level access control policies
  • Encrypted at rest: Supabase handles encryption (AES-256)
  • TLS in transit: All database connections encrypted (TLS 1.2+)
  • Credential rotation: Service keys stored in environment variables

User Data Handling

  • Minimal data collection: Email, name, phone (optional), company (optional)
  • Financial data: Not stored long-term; used for calculation then discarded
  • Valuation history: Stored with user consent for report regeneration
  • Anonymous usage: Free tier tracks IP + user agent (no PII required)

Third-Party Services

  • Supabase: Database, auth, storage (SOC 2 Type II)
  • OpenAI: AI analysis features (optional, user-initiated)
  • Stripe: Payment processing (PCI DSS compliant)
  • Vercel: Hosting platform (ISO 27001)

Audit Logging

  • Usage violations: IP, timestamp, violation type, user agent
  • Authentication events: Login, logout, password reset tracked by Supabase
  • Admin actions: User role changes, plan modifications logged
  • Daily usage: Analysis count, cost tracking stored per user

Current Limitations & Roadmap

Transparency about security features NOT currently implemented:

Not Yet Implemented

  • SOC 2 Type II compliance: Mentioned on homepage as "in progress" but not certified
  • Penetration testing: No formal third-party security audits conducted
  • GDPR compliance tooling: No automated data export or deletion workflows
  • Two-factor authentication: Only email/password or OAuth currently supported
  • WAF (Web Application Firewall): No dedicated DDoS or bot protection layer

On Roadmap

  • CSP headers: Content Security Policy to prevent XSS injection
  • Enhanced rate limiting: Per-endpoint granular throttling beyond plan limits
  • Anomaly detection: Automated flagging of unusual usage patterns
  • Encrypted field-level storage: Additional encryption layer for sensitive financial data
  • Automated vulnerability scanning: Regular dependency audits and SAST integration

Required Environment Variables

Documentation of sensitive configuration required for deployment. All values stored in .env.local (not committed to git).

VariablePurposeRequired
NEXT_PUBLIC_SUPABASE_URLSupabase project URLYes
NEXT_PUBLIC_SUPABASE_ANON_KEYPublic API key (client-side)Yes
SUPABASE_SERVICE_ROLE_KEYAdmin operations (server-side only)Yes
OPENAI_API_KEYAI analysis featuresOptional
STRIPE_SECRET_KEYPayment processingYes
STRIPE_WEBHOOK_SECRETWebhook signature verificationYes
CRON_SECRETCron job authenticationYes
AI_FEATURES_ENABLEDToggle AI functionalityOptional
DEV_BYPASS_AUTHDevelopment mode (NEVER in production)Dev only

Security Warning: Service role key and Stripe secret have full database access and payment authority. Never expose in client-side code or commit to version control.

Reporting Security Vulnerabilities

If you discover a security vulnerability in Succedence, please report it responsibly:

Contact

Email: evank8029@gmail.com

We'll acknowledge receipt within 48 hours and provide a timeline for resolution.

Please Include

  • • Description of the vulnerability
  • • Steps to reproduce
  • • Potential impact assessment
  • • Suggested remediation (if applicable)

Questions about our security?

Contact us for enterprise security documentation or compliance questionnaires.

Contact Us