一键导入
supabase-report
Generate a comprehensive Markdown security audit report with executive summary, findings, and remediation guidance.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate a comprehensive Markdown security audit report with executive summary, findings, and remediation guidance.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Orchestrate a complete Supabase security audit with guided step-by-step execution and ownership confirmation.
Test Row Level Security (RLS) policies for common bypass vulnerabilities and misconfigurations.
List and test exposed PostgreSQL RPC functions for security issues and potential RLS bypass.
List all tables exposed via the Supabase PostgREST API to identify the attack surface.
Attempt to read data from exposed tables to verify actual data exposure and RLS effectiveness.
Analyze Supabase authentication configuration for security weaknesses and misconfigurations.
| name | supabase-report |
| description | Generate a comprehensive Markdown security audit report with executive summary, findings, and remediation guidance. |
🔴 CRITICAL: PROGRESSIVE FILE UPDATES REQUIRED
You MUST write to context files AS YOU GO, not just at the end.
- Write to
.sb-pentest-audit.logIMMEDIATELY as you process each section- Update
.sb-pentest-context.jsonwith report metadata progressively- DO NOT wait until the entire report is generated to update files
- If the skill crashes or is interrupted, the partial progress must already be saved
This is not optional. Failure to write progressively is a critical error.
This skill generates a comprehensive Markdown security audit report from all collected findings.
.sb-pentest-context.jsonThe generated report includes:
Generate security report from audit findings
Generate report as security-audit-2025-01.md
Generate executive summary only
The skill generates supabase-audit-report.md:
# Supabase Security Audit Report
**Target:** https://myapp.example.com
**Project:** abc123def.supabase.co
**Date:** January 31, 2025
**Auditor:** Internal Security Team
---
## Executive Summary
### Overview
This security audit identified **12 vulnerabilities** across the Supabase implementation, including **3 critical (P0)** issues requiring immediate attention.
### Key Findings
| Severity | Count | Status |
|----------|-------|--------|
| 🔴 P0 (Critical) | 3 | Immediate action required |
| 🟠 P1 (High) | 4 | Address within 7 days |
| 🟡 P2 (Medium) | 5 | Address within 30 days |
### Security Score
**Score: 35/100 (Grade: D)**
The application has significant security gaps that expose user data and allow privilege escalation. Critical issues must be addressed before the application can be considered secure.
### Most Critical Issues
1. **Service Role Key Exposed** — Full database access possible
2. **Database Backups Public** — All data downloadable
3. **Admin Function No Auth** — Any user can access admin features
### Recommended Actions
1. ⚡ **Immediate (Today):**
- Rotate service role key
- Make backup bucket private
- Add admin role verification
2. 🔜 **This Week:**
- Enable RLS on all tables
- Enable email confirmation
- Fix IDOR in Edge Functions
3. 📅 **This Month:**
- Strengthen password policy
- Restrict CORS origins
- Add rate limiting to functions
---
## Critical Findings (P0)
### P0-001: Service Role Key Exposed in Client Code
**Severity:** 🔴 Critical
**Component:** Key Management
**CVSS:** 9.8 (Critical)
#### Description
The Supabase service_role key was found in client-side JavaScript code. This key bypasses all Row Level Security policies and provides full database access.
#### Location
File: /static/js/admin.chunk.js Line: 89 Code: const SUPABASE_KEY = 'eyJhbGciOiJIUzI1NiI...'
#### Impact
- Full read/write access to all database tables
- Bypass of all RLS policies
- Access to auth.users table (all user data)
- Ability to delete or modify any data
#### Proof of Concept
```bash
curl 'https://abc123def.supabase.co/rest/v1/users' \
-H 'apikey: [service_role_key]' \
-H 'Authorization: Bearer [service_role_key]'
# Returns ALL users with full data
Immediate:
Long-term:
// Move privileged operations to Edge Functions
// supabase/functions/admin-action/index.ts
import { createClient } from '@supabase/supabase-js'
Deno.serve(async (req) => {
// Service key only on server
const supabase = createClient(
Deno.env.get('SUPABASE_URL')!,
Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')!
)
// Verify caller is admin before proceeding
// ...
})
Documentation:
Severity: 🔴 Critical Component: Storage CVSS: 9.1 (Critical)
The storage bucket named "backups" is configured as public, exposing database dumps, user exports, and environment secrets.
| File | Size | Content |
|---|---|---|
| db-backup-2025-01-30.sql | 125MB | Full database dump |
| users-export.csv | 2.3MB | All user data with PII |
| secrets.env | 1KB | API keys and passwords |
Immediate:
-- Make bucket private
UPDATE storage.buckets
SET public = false
WHERE name = 'backups';
-- Delete or move files
-- Consider incident response procedures
Credential Rotation:
Severity: 🔴 Critical Component: Edge Functions CVSS: 8.8 (High)
The /functions/v1/admin-panel Edge Function is accessible to any authenticated user without role verification.
[... additional P0 findings ...]
Severity: 🟠 High Component: Authentication
[... P1 findings ...]
Severity: 🟡 Medium Component: Authentication
[... P2 findings ...]
| Table | RLS | Access Level | Status |
|---|---|---|---|
| users | ❌ | Full read | 🔴 P0 |
| orders | ✅ | None | ✅ |
| posts | ✅ | Published only | ✅ |
| Bucket | Public | Sensitive Files | Status |
|---|---|---|---|
| avatars | Yes | No | ✅ |
| backups | Yes | Yes (45 files) | 🔴 P0 |
| Setting | Current | Recommended | Status |
|---|---|---|---|
| Email confirm | Disabled | Enabled | 🟠 P1 |
| Password min | 6 | 8+ | 🟡 P2 |
| ID | Action | Owner | Deadline |
|---|---|---|---|
| P0-001 | Rotate service key | DevOps | Today |
| P0-002 | Make backups private | DevOps | Today |
| P0-003 | Add admin role check | Backend | Today |
| ID | Action | Owner | Deadline |
|---|---|---|---|
| P1-001 | Enable email confirmation | Backend | 3 days |
| P1-002 | Fix IDOR in get-user-data | Backend | 3 days |
| ID | Action | Owner | Deadline |
|---|---|---|---|
| P2-001 | Strengthen password policy | Backend | 14 days |
| P2-002 | Restrict CORS origins | DevOps | 14 days |
This audit was performed using the Supabase Pentest Skills toolkit, which includes:
Full audit log available in .sb-pentest-audit.log
Report generated by supabase-pentest-skills Audit completed: January 31, 2025 at 15:00 UTC
## Score Calculation
The security score is calculated based on:
| Factor | Weight | Calculation |
|--------|--------|-------------|
| P0 findings | -25 per issue | Critical vulnerabilities |
| P1 findings | -10 per issue | High severity issues |
| P2 findings | -5 per issue | Medium severity issues |
| RLS coverage | +10 if 100% | All tables have RLS |
| Auth hardening | +10 | Email confirm, strong passwords |
| Base score | 100 | Starting point |
### Grade Scale
| Score | Grade | Description |
|-------|-------|-------------|
| 90-100 | A | Excellent security posture |
| 80-89 | B | Good, minor improvements needed |
| 70-79 | C | Acceptable, address issues |
| 60-69 | D | Poor, significant issues |
| 0-59 | F | Critical, immediate action needed |
## Context Input
The report generator reads from `.sb-pentest-context.json`:
```json
{
"target_url": "https://myapp.example.com",
"supabase": {
"project_url": "https://abc123def.supabase.co",
"project_ref": "abc123def"
},
"findings": [
{
"id": "P0-001",
"severity": "P0",
"component": "keys",
"title": "Service Role Key Exposed",
"description": "...",
"location": "...",
"remediation": "..."
}
],
"audit_completed": "2025-01-31T15:00:00Z"
}
Generate report without appendix
Generate report with executive summary only
Generate report in JSON format
Generate report summary as HTML
⚠️ This skill REQUIRES properly populated tracking files.
Before generating a report, ensure:
.sb-pentest-context.json exists and contains findings from audit skills.sb-pentest-audit.log exists with timestamped actionsIf context files are missing or empty:
supabase-pentest for a complete auditAfter generating the report, this skill MUST:
Log to .sb-pentest-audit.log:
[TIMESTAMP] [supabase-report] [START] Generating security report
[TIMESTAMP] [supabase-report] [SUCCESS] Report generated: supabase-audit-report.md
[TIMESTAMP] [supabase-report] [CONTEXT_UPDATED] Report generation logged
Update .sb-pentest-context.json with report metadata:
{
"report": {
"generated_at": "...",
"filename": "supabase-audit-report.md",
"findings_count": { "p0": 3, "p1": 4, "p2": 5 }
}
}
FAILURE TO UPDATE CONTEXT FILES IS NOT ACCEPTABLE.
supabase-report-compare — Compare with previous reportssupabase-pentest — Run full audit firstsupabase-help — List all available skills