supabase-audit-auth-config by yoanbernabeu/supabase-pentest-skills
npx skills add https://github.com/yoanbernabeu/supabase-pentest-skills --skill supabase-audit-auth-config🔴 关键:需要渐进式文件更新
你必须在分析过程中就写入上下文文件,而不是等到最后。
- 分析完每个设置后立即写入
.sb-pentest-context.json- 每次测试前后记录到
.sb-pentest-audit.log- 不要等到技能完成才更新文件
- 如果技能崩溃或被中断,所有先前的发现必须已经保存
这不是可选的。未能渐进式写入是一个严重错误。
此技能分析 Supabase 项目的身份验证配置。
Supabase Auth (GoTrue) 公开:
https://[project].supabase.co/auth/v1/
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 端点 | 用途 |
|---|---|
/auth/v1/settings | 公共设置(有限) |
/auth/v1/signup | 用户注册 |
/auth/v1/token | 身份验证 |
/auth/v1/user | 当前用户信息 |
/auth/v1/recover | 密码恢复 |
从公共 API 中,我们可以检测:
| 设置 | 检测方法 |
|---|---|
| 电子邮件身份验证已启用 | 尝试注册 |
| 电话身份验证已启用 | 检查设置 |
| OAuth 提供商 | 检查设置 |
| 注册已禁用 | 尝试注册 |
| 电子邮件确认 | 注册响应 |
| 密码要求 | 错误消息 |
审计身份验证配置
检查注册是否开放以及启用了哪些提供商
═══════════════════════════════════════════════════════════
身份验证配置审计
═══════════════════════════════════════════════════════════
项目:abc123def.supabase.co
身份验证端点:https://abc123def.supabase.co/auth/v1/
─────────────────────────────────────────────────────────
身份验证方法
─────────────────────────────────────────────────────────
电子邮件/密码:✅ 已启用
├── 注册:✅ 开放(任何人都可以注册)
├── 电子邮件确认:❌ 不需要 ← P1 问题
├── 密码最小长度:6 个字符 ← P2 考虑增加长度
└── 安全密码检查:未知
电话/SMS:✅ 已启用
└── 提供商:Twilio
魔法链接:✅ 已启用
└── OTP 过期时间:300 秒(5 分钟)
检测到的 OAuth 提供商:3
├── Google:✅ 已启用
├── GitHub:✅ 已启用
└── Discord:✅ 已启用
匿名身份验证:✅ 已启用 ← 审查是否是有意为之
─────────────────────────────────────────────────────────
安全设置
─────────────────────────────────────────────────────────
速率限制:
├── 注册:每个 IP 3 次/小时(良好)
├── 令牌:每个 IP 30 次/小时(良好)
└── 恢复:每个 IP 3 次/小时(良好)
会话配置:
├── JWT 过期时间:3600 秒(1 小时)
├── 刷新令牌轮换:未知
└── 不活动超时:未知
安全头:
├── CORS:已配置
├── 允许的来源:*(通配符)← P2 考虑限制
└── 凭据:允许
─────────────────────────────────────────────────────────
发现
─────────────────────────────────────────────────────────
🟠 P1:电子邮件确认已禁用
问题:用户无需验证电子邮件地址即可注册并立即访问应用。
风险:
├── 使用无效电子邮件的虚假账户
├── 域名抢注(例如 user@gmial.com)
├── 没有经过验证的通信渠道
└── 潜在的滥用风险
建议:
Supabase 仪表盘 → 身份验证 → 电子邮件模板
→ 启用“确认电子邮件”
─────────────────────────────────────────────────────────
🟡 P2:最小密码长度过短
问题:最小密码长度为 6 个字符。
建议:将最小长度增加到 8-12 个字符。
Supabase 仪表盘 → 身份验证 → 设置
→ 最小密码长度
─────────────────────────────────────────────────────────
🟡 P2:通配符 CORS 来源
问题:CORS 允许来自任何来源(*)的请求。
建议:仅限制到你的域名。
Supabase 仪表盘 → 身份验证 → URL 配置
→ 站点 URL 和重定向 URL
─────────────────────────────────────────────────────────
ℹ️ 信息:匿名身份验证已启用
注意:匿名身份验证已启用。
如果是有意为之(访客访问),这没问题。
如果你期望所有用户都经过身份验证,请进行审查。
─────────────────────────────────────────────────────────
摘要
─────────────────────────────────────────────────────────
身份验证方法:已启用 5 种
OAuth 提供商:3 个
发现:
├── P1(高):1 个 - 电子邮件确认已禁用
├── P2(中):2 个 - 密码长度,CORS
└── 信息:1 个 - 匿名身份验证已启用
建议操作:
1. 启用电子邮件确认
2. 增加最小密码长度
3. 将 CORS 限制到特定域名
4. 审查是否需要匿名身份验证
═══════════════════════════════════════════════════════════
| 设置 | 建议 | 错误的风险 |
|---|---|---|
| 电子邮件确认 | ✅ 必需 | 虚假账户 |
| 密码长度 | ≥8 个字符 | 弱密码 |
| 密码复杂度 | 启用 | 易于猜测 |
| 速率限制 | 启用 | 暴力破解 |
| 设置 | 建议 | 错误的风险 |
|---|---|---|
| 仅已验证的提供商 | 是 | 账户接管 |
| 正确的重定向 URL | 特定的 URL | OAuth 重定向攻击 |
| 状态参数 | 已启用 | CSRF 攻击 |
| 设置 | 建议 | 错误的风险 |
|---|---|---|
| 较短的 JWT 过期时间 | 1 小时或更短 | 令牌盗窃 |
| 刷新令牌轮换 | 已启用 | 令牌重用 |
| 安全的 Cookie 标志 | HttpOnly, Secure, SameSite | XSS, CSRF |
{
"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"
}
]
}
}
// 用户可以使用任何电子邮件注册
const { data, error } = await supabase.auth.signUp({
email: 'fake@example.com', // 无需验证
password: 'password123'
})
// 用户立即通过身份验证
// 接受弱密码
await supabase.auth.signUp({
email: 'user@example.com',
password: '123456' // 最小长度为 6 时被接受
})
如果你的应用应该只有管理员创建的用户:
-- 通过仪表盘禁用公共注册
-- 或使用仅限邀请流程
⚠️ 此技能必须在执行过程中渐进式更新跟踪文件,而不是仅在最后更新。
不要在最后批量写入所有内容。而是:
.sb-pentest-audit.log.sb-pentest-context.json这确保了如果技能被中断、崩溃或超时,所有到该点为止的发现都会被保留。
更新.sb-pentest-context.json 并包含结果:
{
"auth_config": {
"timestamp": "...",
"methods": { ... },
"findings": [ ... ]
}
}
记录到.sb-pentest-audit.log:
[TIMESTAMP] [supabase-audit-auth-config] [START] Auditing auth configuration
[TIMESTAMP] [supabase-audit-auth-config] [FINDING] P1: Email confirmation disabled
[TIMESTAMP] [supabase-audit-auth-config] [CONTEXT_UPDATED] .sb-pentest-context.json updated
如果文件不存在,在写入前创建它们。
未能更新上下文文件是不可接受的。
📁 证据目录: .sb-pentest-evidence/05-auth-audit/
| 文件 | 内容 |
|---|---|
auth-settings.json | 完整的身份验证配置 |
{
"evidence_id": "AUTH-CFG-001",
"timestamp": "2025-01-31T10:50:00Z",
"category": "auth-audit",
"type": "auth_configuration",
"endpoint": "https://abc123def.supabase.co/auth/v1/",
"configuration": {
"email_auth": {
"enabled": true,
"signup_open": true,
"email_confirmation_required": false,
"min_password_length": 6
},
"phone_auth": {
"enabled": true,
"provider": "twilio"
},
"oauth_providers": ["google", "github", "discord"],
"anonymous_auth": true
},
"security_settings": {
"rate_limiting": {
"signup": "3/hour",
"token": "30/hour",
"recovery": "3/hour"
},
"jwt_expiry": 3600,
"cors_origins": "*"
},
"findings": [
{
"severity": "P1",
"issue": "Email confirmation disabled",
"impact": "Users can signup without verifying email",
"recommendation": "Enable email confirmation"
},
{
"severity": "P2",
"issue": "Weak password policy",
"impact": "Minimum 6 characters allows weak passwords",
"recommendation": "Increase to 8+ characters"
}
]
}
# === 身份验证配置测试 ===
# 测试注册可用性
curl -X POST "$SUPABASE_URL/auth/v1/signup" \
-H "apikey: $ANON_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "test@example.com", "password": "test123456"}'
# 测试密码策略(弱密码)
curl -X POST "$SUPABASE_URL/auth/v1/signup" \
-H "apikey: $ANON_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "weak@example.com", "password": "123456"}'
supabase-audit-auth-signup — 测试注册流程supabase-audit-auth-users — 测试用户枚举supabase-audit-rls — 身份验证用户需要 RLS 保护每周安装次数
106
仓库
GitHub 星标数
32
首次出现
Jan 31, 2026
安全审计
安装于
claude-code86
codex81
opencode79
gemini-cli77
cursor70
github-copilot69
🔴 CRITICAL: PROGRESSIVE FILE UPDATES REQUIRED
You MUST write to context files AS YOU GO , not just at the end.
- Write to
.sb-pentest-context.jsonIMMEDIATELY after each setting analyzed- Log to
.sb-pentest-audit.logBEFORE 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.
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 |
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 |
Audit authentication configuration
Check if signup is open and what providers are enabled
═══════════════════════════════════════════════════════════
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 (user@gmial.com)
├── 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
═══════════════════════════════════════════════════════════
| 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 |
| Setting | Recommended | Risk if Wrong |
|---|---|---|
| Verified providers only | Yes | Account takeover |
| Proper redirect URLs | Specific URLs | OAuth redirect attacks |
| State parameter | Enabled | CSRF attacks |
| 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 |
{
"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"
}
]
}
}
// User can signup with any email
const { data, error } = await supabase.auth.signUp({
email: 'fake@example.com', // No verification needed
password: 'password123'
})
// User is immediately authenticated
// Weak password accepted
await supabase.auth.signUp({
email: 'user@example.com',
password: '123456' // Accepted with min length 6
})
If your app should only have admin-created users:
-- Disable public signup via dashboard
-- Or use invite-only flow
⚠️ This skill MUST update tracking files PROGRESSIVELY during execution, NOT just at the end.
DO NOT batch all writes at the end. Instead:
.sb-pentest-audit.log.sb-pentest-context.jsonThis ensures that if the skill is interrupted, crashes, or times out, all findings up to that point are preserved.
Update.sb-pentest-context.json with results:
{
"auth_config": {
"timestamp": "...",
"methods": { ... },
"findings": [ ... ]
}
}
Log to.sb-pentest-audit.log:
[TIMESTAMP] [supabase-audit-auth-config] [START] Auditing auth configuration
[TIMESTAMP] [supabase-audit-auth-config] [FINDING] P1: Email confirmation disabled
[TIMESTAMP] [supabase-audit-auth-config] [CONTEXT_UPDATED] .sb-pentest-context.json updated
If files don't exist , create them before writing.
FAILURE TO UPDATE CONTEXT FILES IS NOT ACCEPTABLE.
📁 Evidence Directory: .sb-pentest-evidence/05-auth-audit/
| File | Content |
|---|---|
auth-settings.json | Complete auth configuration |
{
"evidence_id": "AUTH-CFG-001",
"timestamp": "2025-01-31T10:50:00Z",
"category": "auth-audit",
"type": "auth_configuration",
"endpoint": "https://abc123def.supabase.co/auth/v1/",
"configuration": {
"email_auth": {
"enabled": true,
"signup_open": true,
"email_confirmation_required": false,
"min_password_length": 6
},
"phone_auth": {
"enabled": true,
"provider": "twilio"
},
"oauth_providers": ["google", "github", "discord"],
"anonymous_auth": true
},
"security_settings": {
"rate_limiting": {
"signup": "3/hour",
"token": "30/hour",
"recovery": "3/hour"
},
"jwt_expiry": 3600,
"cors_origins": "*"
},
"findings": [
{
"severity": "P1",
"issue": "Email confirmation disabled",
"impact": "Users can signup without verifying email",
"recommendation": "Enable email confirmation"
},
{
"severity": "P2",
"issue": "Weak password policy",
"impact": "Minimum 6 characters allows weak passwords",
"recommendation": "Increase to 8+ characters"
}
]
}
# === AUTH CONFIGURATION TESTS ===
# Test signup availability
curl -X POST "$SUPABASE_URL/auth/v1/signup" \
-H "apikey: $ANON_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "test@example.com", "password": "test123456"}'
# Test password policy (weak password)
curl -X POST "$SUPABASE_URL/auth/v1/signup" \
-H "apikey: $ANON_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "weak@example.com", "password": "123456"}'
supabase-audit-auth-signup — Test signup flowsupabase-audit-auth-users — Test user enumerationsupabase-audit-rls — Auth users need RLS protectionWeekly Installs
106
Repository
GitHub Stars
32
First Seen
Jan 31, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
claude-code86
codex81
opencode79
gemini-cli77
cursor70
github-copilot69
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
104,900 周安装