supabase-report
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSecurity Report Generator
安全审计报告生成器
🔴 CRITICAL: PROGRESSIVE FILE UPDATES REQUIREDYou MUST write to context files AS YOU GO, not just at the end.
- Write to
IMMEDIATELY as you process each section.sb-pentest-audit.log- Update
with report metadata progressively.sb-pentest-context.json- 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-audit.log- 逐步更新
中的报告元数据.sb-pentest-context.json- 不要等到整个报告生成后再更新文件
- 如果技能崩溃或被中断,部分进度必须已保存
此要求为强制项。不逐步写入属于严重错误。
本技能可根据所有收集到的调查结果生成全面的Markdown安全审计报告。
When to Use This Skill
使用场景
- After completing security audit phases
- To document findings for stakeholders
- To create actionable remediation plans
- For compliance and audit trail purposes
- 完成安全审计阶段后
- 为利益相关者记录调查结果
- 创建可执行的修复计划
- 用于合规性和审计跟踪目的
Prerequisites
前置条件
- Audit phases completed (context file populated)
- Findings collected in
.sb-pentest-context.json
- 已完成审计阶段(上下文文件已填充)
- 调查结果已收集在中
.sb-pentest-context.json
Report Structure
报告结构
The generated report includes:
- Executive Summary — High-level overview for management
- Security Score — Quantified risk assessment
- Critical Findings (P0) — Immediate action required
- High Findings (P1) — Address soon
- Medium Findings (P2) — Plan to address
- Detailed Analysis — Per-component breakdown
- Remediation Plan — Prioritized action items
- Appendix — Technical details, methodology
生成的报告包含:
- 执行摘要 — 面向管理层的高层概述
- 安全评分 — 量化的风险评估
- 严重级调查结果(P0) — 需立即处理
- 高风险调查结果(P1) — 需尽快处理
- 中风险调查结果(P2) — 计划处理
- 详细分析 — 按组件细分
- 修复计划 — 按优先级排序的行动项
- 附录 — 技术细节、方法论
Usage
使用方法
Generate Report
生成报告
Generate security report from audit findingsGenerate security report from audit findingsCustom Report Name
自定义报告名称
Generate report as security-audit-2025-01.mdGenerate report as security-audit-2025-01.mdSpecific Sections
生成指定部分
Generate executive summary onlyGenerate executive summary onlyOutput Format
输出格式
The skill generates :
supabase-audit-report.mdmarkdown
undefined本技能会生成:
supabase-audit-report.mdmarkdown
undefinedSupabase Security Audit Report
Supabase安全审计报告
Target: https://myapp.example.com
Project: abc123def.supabase.co
Date: January 31, 2025
Auditor: Internal Security Team
目标地址: https://myapp.example.com
项目: abc123def.supabase.co
日期: 2025年1月31日
审计方: 内部安全团队
Executive Summary
执行摘要
Overview
概述
This security audit identified 12 vulnerabilities across the Supabase implementation, including 3 critical (P0) issues requiring immediate attention.
本次安全审计在Supabase实现中发现了12个漏洞,其中包括**3个严重级(P0)**问题,需立即处理。
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 |
| 严重级别 | 数量 | 处理状态 |
|---|---|---|
| 🔴 P0(严重) | 3 | 需立即处理 |
| 🟠 P1(高风险) | 4 | 7天内处理 |
| 🟡 P2(中风险) | 5 | 30天内处理 |
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.
评分: 35/100(等级: D)
该应用存在重大安全漏洞,可能导致用户数据泄露和权限提升。在解决严重级问题前,应用无法被视为安全。
Most Critical Issues
最严重问题
- Service Role Key Exposed — Full database access possible
- Database Backups Public — All data downloadable
- Admin Function No Auth — Any user can access admin features
- Service Role密钥暴露 — 可获取数据库完全访问权限
- 数据库备份公开 — 所有数据可被下载
- 管理员功能无认证 — 任何用户均可访问管理员功能
Recommended Actions
建议行动
-
⚡ Immediate (Today):
- Rotate service role key
- Make backup bucket private
- Add admin role verification
-
🔜 This Week:
- Enable RLS on all tables
- Enable email confirmation
- Fix IDOR in Edge Functions
-
📅 This Month:
- Strengthen password policy
- Restrict CORS origins
- Add rate limiting to functions
-
⚡ 立即(今日):
- 轮换Service Role密钥
- 将备份存储桶设为私有
- 添加管理员角色验证
-
🔜 本周内:
- 为所有表启用RLS
- 启用邮箱确认功能
- 修复Edge Functions中的IDOR问题
-
📅 本月内:
- 强化密码策略
- 限制CORS源
- 为函数添加速率限制
Critical Findings (P0)
严重级调查结果(P0)
P0-001: Service Role Key Exposed in Client Code
P0-001: 客户端代码中暴露Service Role密钥
Severity: 🔴 Critical
Component: Key Management
CVSS: 9.8 (Critical)
严重级别: 🔴 严重
组件: 密钥管理
CVSS: 9.8(严重)
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.
在客户端JavaScript代码中发现了Supabase的service_role密钥。此密钥可绕过所有Row Level Security(RLS)策略,获得数据库的完全访问权限。
Location
位置
File: /static/js/admin.chunk.js
Line: 89
Code: const SUPABASE_KEY = 'eyJhbGciOiJIUzI1NiI...'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
- 对所有数据库表拥有完全读写权限
- 绕过所有RLS策略
- 可访问auth.users表(所有用户数据)
- 可删除或修改任意数据
Proof of Concept
验证步骤
bash
curl 'https://abc123def.supabase.co/rest/v1/users' \
-H 'apikey: [service_role_key]' \
-H 'Authorization: Bearer [service_role_key]'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
返回所有用户的完整数据
undefinedundefinedRemediation
修复方案
Immediate:
- Rotate the service role key in Supabase Dashboard
- Settings → API → Regenerate service_role key
- Remove the key from client code
- Redeploy the application
Long-term:
typescript
// 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:
立即执行:
- 在Supabase控制台中轮换Service Role密钥
- 设置 → API → 重新生成service_role密钥
- 从客户端代码中移除该密钥
- 重新部署应用
长期方案:
typescript
// 将特权操作迁移至Edge Functions
// supabase/functions/admin-action/index.ts
import { createClient } from '@supabase/supabase-js'
Deno.serve(async (req) => {
// Service密钥仅存储在服务器端
const supabase = createClient(
Deno.env.get('SUPABASE_URL')!,
Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')!
)
// 先验证调用者是否为管理员
// ...
})参考文档:
P0-002: Database Backups Publicly Accessible
P0-002: 数据库备份可公开访问
Severity: 🔴 Critical
Component: Storage
CVSS: 9.1 (Critical)
严重级别: 🔴 严重
组件: 存储
CVSS: 9.1(严重)
Description
描述
The storage bucket named "backups" is configured as public, exposing database dumps, user exports, and environment secrets.
名为"backups"的存储桶被配置为公开,导致数据库备份、用户导出数据和环境密钥暴露。
Exposed Files
暴露文件
| 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 |
| 文件 | 大小 | 内容 |
|---|---|---|
| db-backup-2025-01-30.sql | 125MB | 完整数据库备份 |
| users-export.csv | 2.3MB | 包含PII的所有用户数据 |
| secrets.env | 1KB | API密钥和密码 |
Impact
影响
- Complete data breach (all database content)
- Exposed credentials for third-party services
- User PII exposed (emails, names, etc.)
- 数据完全泄露(所有数据库内容)
- 第三方服务凭证暴露
- 用户PII(邮箱、姓名等)暴露
Remediation
修复方案
Immediate:
sql
-- Make bucket private
UPDATE storage.buckets
SET public = false
WHERE name = 'backups';
-- Delete or move files
-- Consider incident response proceduresCredential Rotation:
- Stripe API keys
- Database password
- JWT secret
- Any other keys in secrets.env
立即执行:
sql
-- 将存储桶设为私有
UPDATE storage.buckets
SET public = false
WHERE name = 'backups';
-- 删除或转移文件
-- 考虑启动事件响应流程凭证轮换:
- Stripe API密钥
- 数据库密码
- JWT密钥
- secrets.env中的其他所有密钥
P0-003: Admin Edge Function Privilege Escalation
P0-003: 管理员Edge Functions权限提升
Severity: 🔴 Critical
Component: Edge Functions
CVSS: 8.8 (High)
严重级别: 🔴 严重
组件: Edge Functions
CVSS: 8.8(高风险)
Description
描述
The Edge Function is accessible to any authenticated user without role verification.
/functions/v1/admin-panel[... additional P0 findings ...]
/functions/v1/admin-panel[... 其他P0调查结果 ...]
High Findings (P1)
高风险调查结果(P1)
P1-001: Email Confirmation Disabled
P1-001: 邮箱确认功能已禁用
Severity: 🟠 High
Component: Authentication
[... P1 findings ...]
严重级别: 🟠 高风险
组件: 认证
[... P1调查结果 ...]
Medium Findings (P2)
中风险调查结果(P2)
P2-001: Weak Password Policy
P2-001: 密码策略薄弱
Severity: 🟡 Medium
Component: Authentication
[... P2 findings ...]
严重级别: 🟡 中风险
组件: 认证
[... P2调查结果 ...]
Detailed Analysis by Component
按组件细分的详细分析
API Security
API安全
| Table | RLS | Access Level | Status |
|---|---|---|---|
| users | ❌ | Full read | 🔴 P0 |
| orders | ✅ | None | ✅ |
| posts | ✅ | Published only | ✅ |
| 表名 | RLS启用状态 | 访问级别 | 状态 |
|---|---|---|---|
| users | ❌ | 完全可读 | 🔴 P0 |
| orders | ✅ | 无访问权限 | ✅ |
| posts | ✅ | 仅已发布内容 | ✅ |
Storage Security
存储安全
| Bucket | Public | Sensitive Files | Status |
|---|---|---|---|
| avatars | Yes | No | ✅ |
| backups | Yes | Yes (45 files) | 🔴 P0 |
| 存储桶 | 公开状态 | 包含敏感文件 | 状态 |
|---|---|---|---|
| avatars | 是 | 否 | ✅ |
| backups | 是 | 是(45个文件) | 🔴 P0 |
Authentication
认证安全
| Setting | Current | Recommended | Status |
|---|---|---|---|
| Email confirm | Disabled | Enabled | 🟠 P1 |
| Password min | 6 | 8+ | 🟡 P2 |
| 设置项 | 当前状态 | 推荐状态 | 状态 |
|---|---|---|---|
| 邮箱确认 | 已禁用 | 启用 | 🟠 P1 |
| 最小密码长度 | 6 | 8+ | 🟡 P2 |
Remediation Plan
修复计划
Phase 1: Critical (Immediate)
阶段1: 严重级(立即执行)
| 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 | 行动项 | 负责人 | 截止日期 |
|---|---|---|---|
| P0-001 | 轮换Service密钥 | DevOps | 今日 |
| P0-002 | 将备份存储桶设为私有 | DevOps | 今日 |
| P0-003 | 添加管理员角色校验 | 后端团队 | 今日 |
Phase 2: High Priority (This Week)
阶段2: 高优先级(本周内)
| ID | Action | Owner | Deadline |
|---|---|---|---|
| P1-001 | Enable email confirmation | Backend | 3 days |
| P1-002 | Fix IDOR in get-user-data | Backend | 3 days |
| ID | 行动项 | 负责人 | 截止日期 |
|---|---|---|---|
| P1-001 | 启用邮箱确认功能 | 后端团队 | 3天内 |
| P1-002 | 修复get-user-data中的IDOR问题 | 后端团队 | 3天内 |
Phase 3: Medium Priority (This Month)
阶段3: 中优先级(本月内)
| ID | Action | Owner | Deadline |
|---|---|---|---|
| P2-001 | Strengthen password policy | Backend | 14 days |
| P2-002 | Restrict CORS origins | DevOps | 14 days |
| ID | 行动项 | 负责人 | 截止日期 |
|---|---|---|---|
| P2-001 | 强化密码策略 | 后端团队 | 14天内 |
| P2-002 | 限制CORS源 | DevOps | 14天内 |
Appendix
附录
A. Methodology
A. 方法论
This audit was performed using the Supabase Pentest Skills toolkit, which includes:
- Passive reconnaissance of client-side code
- API endpoint testing with anon and service keys
- Storage bucket enumeration and access testing
- Authentication flow analysis
- Real-time channel subscription testing
本次审计使用Supabase Pentest Skills工具包执行,包括:
- 客户端代码的被动侦察
- 使用anon和service密钥测试API端点
- 存储桶枚举和访问测试
- 认证流程分析
- 实时频道订阅测试
B. Tools Used
B. 使用工具
- supabase-pentest-skills v1.0.0
- curl for API testing
- Browser DevTools for client code analysis
- supabase-pentest-skills v1.0.0
- curl(用于API测试)
- 浏览器开发者工具(用于客户端代码分析)
C. Audit Scope
C. 审计范围
- Target URL: https://myapp.example.com
- Supabase Project: abc123def
- Components tested: API, Storage, Auth, Realtime, Edge Functions
- Exclusions: None
- 目标URL: https://myapp.example.com
- Supabase项目: abc123def
- 测试组件: API、存储、认证、实时功能、Edge Functions
- 排除项: 无
D. Audit Log
D. 审计日志
Full audit log available in
.sb-pentest-audit.logReport generated by supabase-pentest-skills
Audit completed: January 31, 2025 at 15:00 UTC
undefined完整审计日志可在中查看
.sb-pentest-audit.log报告由supabase-pentest-skills生成
审计完成时间: 2025年1月31日 15:00 UTC
undefinedScore 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 |
安全评分基于以下因素计算:
| 因素 | 权重 | 计算方式 |
|---|---|---|
| P0调查结果 | 每个扣25分 | 严重级漏洞 |
| P1调查结果 | 每个扣10分 | 高风险问题 |
| P2调查结果 | 每个扣5分 | 中风险问题 |
| RLS覆盖率 | 100%启用加10分 | 所有表均启用RLS |
| 认证强化 | 加10分 | 启用邮箱确认、强密码 |
| 基础分 | 100分 | 起始分数 |
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 |
| 分数区间 | 等级 | 描述 |
|---|---|---|
| 90-100 | A | 安全状况优秀 |
| 80-89 | B | 安全状况良好,需小幅改进 |
| 70-79 | C | 安全状况可接受,需处理现有问题 |
| 60-69 | D | 安全状况较差,存在重大问题 |
| 0-59 | F | 安全状况危急,需立即处理 |
Context Input
上下文输入
The report generator reads from :
.sb-pentest-context.jsonjson
{
"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"
}报告生成器会读取中的数据:
.sb-pentest-context.jsonjson
{
"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"
}Report Customization
报告自定义
Include/Exclude Sections
包含/排除指定部分
Generate report without appendix
Generate report with executive summary onlyGenerate report without appendix
Generate report with executive summary onlyDifferent Formats
生成不同格式
Generate report in JSON format
Generate report summary as HTMLGenerate report in JSON format
Generate report summary as HTMLMANDATORY: Context File Dependency
强制要求:依赖上下文文件
⚠️ This skill REQUIRES properly populated tracking files.
⚠️ 本技能需要已正确填充的跟踪文件。
Prerequisites
前置条件
Before generating a report, ensure:
- exists and contains findings from audit skills
.sb-pentest-context.json - exists with timestamped actions
.sb-pentest-audit.log - All relevant audit skills have updated these files
生成报告前,请确保:
- 已存在,且包含审计技能收集的调查结果
.sb-pentest-context.json - 已存在,包含带时间戳的操作记录
.sb-pentest-audit.log - 所有相关审计技能已更新这些文件
If Context Files Are Missing
上下文文件缺失时的处理
If context files are missing or empty:
- DO NOT generate an empty report
- Inform the user that audit skills must be run first
- Recommend running for a complete audit
supabase-pentest
如果上下文文件缺失或为空:
- 不要生成空报告
- 告知用户需先运行审计技能
- 推荐运行进行完整审计
supabase-pentest
Report Generation Output
报告生成后的强制操作
After 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 -
Updatewith report metadata:
.sb-pentest-context.jsonjson{ "report": { "generated_at": "...", "filename": "supabase-audit-report.md", "findings_count": { "p0": 3, "p1": 4, "p2": 5 } } }
FAILURE TO UPDATE CONTEXT FILES IS NOT ACCEPTABLE.
生成报告后,本技能必须:
-
写入:
.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 -
更新中的报告元数据:
.sb-pentest-context.jsonjson{ "report": { "generated_at": "...", "filename": "supabase-audit-report.md", "findings_count": { "p0": 3, "p1": 4, "p2": 5 } } }
未更新上下文文件属于不可接受的错误。
Related Skills
相关技能
- — Compare with previous reports
supabase-report-compare - — Run full audit first
supabase-pentest - — List all available skills
supabase-help
- — 与历史报告对比
supabase-report-compare - — 先运行完整审计
supabase-pentest - — 列出所有可用技能
supabase-help