Claude
Skills
Sign in
โ† Back

supabase-audit-auth-config

Included with Lifetime
$97 forever

Analyze Supabase authentication configuration for security weaknesses and misconfigurations.

Security

What this skill does


# Authentication Configuration Audit

> ๐Ÿ”ด **CRITICAL: PROGRESSIVE FILE UPDATES REQUIRED**
>
> You MUST write to context files **AS YOU GO**, not just at the end.
> - Write to `.sb-pentest-context.json` **IMMEDIATELY after each setting analyzed**
> - Log to `.sb-pentest-audit.log` **BEFORE and AFTER each test**
> - **DO NOT** wait until the skill completes to update files
> - If the skill crashes or is interrupted, all prior findings must already be saved
>
> **This is not optional. Failure to write progressively is a critical error.**

This skill analyzes the authentication configuration of a Supabase project.

## When to Use This Skill

- To review authentication security settings
- Before production deployment
- When auditing auth-related vulnerabilities
- As part of comprehensive security review

## Prerequisites

- Supabase URL and anon key available
- Detection completed

## Auth Endpoints

Supabase Auth (GoTrue) exposes:

```
https://[project].supabase.co/auth/v1/
```

| Endpoint | Purpose |
|----------|---------|
| `/auth/v1/settings` | Public settings (limited) |
| `/auth/v1/signup` | User registration |
| `/auth/v1/token` | Authentication |
| `/auth/v1/user` | Current user info |
| `/auth/v1/recover` | Password recovery |

## What Can Be Detected

From the public API, we can detect:

| Setting | Detection Method |
|---------|------------------|
| Email auth enabled | Attempt signup |
| Phone auth enabled | Check settings |
| OAuth providers | Check settings |
| Signup disabled | Attempt signup |
| Email confirmation | Signup response |
| Password requirements | Error messages |

## Usage

### Basic Auth Audit

```
Audit authentication configuration
```

### Check Specific Features

```
Check if signup is open and what providers are enabled
```

## Output Format

```
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
 AUTHENTICATION CONFIGURATION AUDIT
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

 Project: abc123def.supabase.co
 Auth Endpoint: https://abc123def.supabase.co/auth/v1/

 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 Authentication Methods
 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

 Email/Password: โœ… Enabled
 โ”œโ”€โ”€ Signup: โœ… Open (anyone can register)
 โ”œโ”€โ”€ Email Confirmation: โŒ NOT REQUIRED โ† P1 Issue
 โ”œโ”€โ”€ Password Min Length: 6 characters โ† P2 Consider longer
 โ””โ”€โ”€ Secure Password Check: Unknown

 Phone/SMS: โœ… Enabled
 โ””โ”€โ”€ Provider: Twilio

 Magic Link: โœ… Enabled
 โ””โ”€โ”€ OTP Expiry: 300 seconds (5 min)

 OAuth Providers Detected: 3
 โ”œโ”€โ”€ Google: โœ… Enabled
 โ”œโ”€โ”€ GitHub: โœ… Enabled
 โ””โ”€โ”€ Discord: โœ… Enabled

 Anonymous Auth: โœ… Enabled โ† Review if intended

 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 Security Settings
 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

 Rate Limiting:
 โ”œโ”€โ”€ Signup: 3/hour per IP (good)
 โ”œโ”€โ”€ Token: 30/hour per IP (good)
 โ””โ”€โ”€ Recovery: 3/hour per IP (good)

 Session Configuration:
 โ”œโ”€โ”€ JWT Expiry: 3600 seconds (1 hour)
 โ”œโ”€โ”€ Refresh Token Rotation: Unknown
 โ””โ”€โ”€ Inactivity Timeout: Unknown

 Security Headers:
 โ”œโ”€โ”€ CORS: Configured
 โ”œโ”€โ”€ Allowed Origins: * (wildcard) โ† P2 Consider restricting
 โ””โ”€โ”€ Credentials: Allowed

 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 Findings
 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

 ๐ŸŸ  P1: Email Confirmation Disabled

 Issue: Users can signup and immediately access the app
        without verifying their email address.

 Risks:
 โ”œโ”€โ”€ Fake accounts with invalid emails
 โ”œโ”€โ”€ Typosquatting ([email protected])
 โ”œโ”€โ”€ No verified communication channel
 โ””โ”€โ”€ Potential for abuse

 Recommendation:
 Supabase Dashboard โ†’ Authentication โ†’ Email Templates
 โ†’ Enable "Confirm email"

 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

 ๐ŸŸก P2: Short Minimum Password Length

 Issue: Minimum password length is 6 characters.

 Recommendation: Increase to 8-12 characters minimum.
 Supabase Dashboard โ†’ Authentication โ†’ Settings
 โ†’ Minimum password length

 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

 ๐ŸŸก P2: Wildcard CORS Origin

 Issue: CORS allows requests from any origin (*).

 Recommendation: Restrict to your domains only.
 Supabase Dashboard โ†’ Authentication โ†’ URL Configuration
 โ†’ Site URL and Redirect URLs

 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

 โ„น๏ธ INFO: Anonymous Auth Enabled

 Note: Anonymous authentication is enabled.

 This is fine if intentional (guest access).
 Review if you expect all users to be authenticated.

 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 Summary
 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

 Auth Methods: 5 enabled
 OAuth Providers: 3

 Findings:
 โ”œโ”€โ”€ P1 (High): 1 - Email confirmation disabled
 โ”œโ”€โ”€ P2 (Medium): 2 - Password length, CORS
 โ””โ”€โ”€ Info: 1 - Anonymous auth enabled

 Recommended Actions:
 1. Enable email confirmation
 2. Increase minimum password length
 3. Restrict CORS to specific domains
 4. Review if anonymous auth is needed

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
```

## Security Checklist

### Email Authentication

| Setting | Recommended | Risk if Wrong |
|---------|-------------|---------------|
| Email Confirmation | โœ… Required | Fake accounts |
| Password Length | โ‰ฅ8 chars | Weak passwords |
| Password Complexity | Enable | Easy to guess |
| Rate Limiting | Enable | Brute force |

### OAuth Configuration

| Setting | Recommended | Risk if Wrong |
|---------|-------------|---------------|
| Verified providers only | Yes | Account takeover |
| Proper redirect URLs | Specific URLs | OAuth redirect attacks |
| State parameter | Enabled | CSRF attacks |

### Session Security

| Setting | Recommended | Risk if Wrong |
|---------|-------------|---------------|
| Short JWT expiry | 1 hour or less | Token theft |
| Refresh token rotation | Enabled | Token reuse |
| Secure cookie flags | HttpOnly, Secure, SameSite | XSS, CSRF |

## Context Output

```json
{
  "auth_config": {
    "timestamp": "2025-01-31T12:30:00Z",
    "methods": {
      "email": {
        "enabled": true,
        "signup_open": true,
        "email_confirmation": false,
        "min_password_length": 6
      },
      "phone": {
        "enabled": true,
        "provider": "twilio"
      },
      "magic_link": {
        "enabled": true,
        "otp_expiry": 300
      },
      "oauth": {
        "enabled": true,
        "providers": ["google", "github", "discord"]
      },
      "anonymous": {
        "enabled": true
      }
    },
    "findings": [
      {
        "severity": "P1",
        "issue": "Email confirmation disabled",
        "recommendation": "Enable email confirmation in dashboard"
      }
    ]
  }
}
```

## Common Auth Vulnerabilities

### 1. No Email Confirmation

```javascript
// User can signup with any email
const { data, error } = await supabase.auth.signUp({
  email: '[email protected]',  // No verification needed
  password: 'password123'
})
// User is immediately authenticated
```

### 2. Weak Password Policy

```javascript
// Weak password accepted
await supabase.auth.signUp({
  email: '[email protected]',
  password: '123456'  // Accepted with min length 6
})
```

### 3. Open Signup When Not Needed

If your app should only have admin-created users:

```sql
-- Disable public signup via dashboard
-- Or use invite-only flow
```

## Remediation Examples

### Enable Email Confirmation

1. Supabase Dashboard โ†’ Authentication โ†’ Email Templates
2. Enable "Confirm email"
3. Customize confirmation email template
4. Handle unconfirmed users in your app

### Strengthen Password Requirements

1. Dashboard โ†’ Authentication โ†’ Settings
2. Set minimum length to 8+
3. Consider enabling password strength checks

### Restrict CORS

1. Dashboard โ†’ Authentication โ†’ URL Configuration
2. Set specific Site URL
3. Add only your domains to Redirect URLs
4. Remove wildcard entries

## MANDATORY: Progressive Context File Updates

โš ๏ธ **This skill MUST update tracking files PROGRESSIVELY during execution, 

Related in Security