supabase-report by yoanbernabeu/supabase-pentest-skills
npx skills add https://github.com/yoanbernabeu/supabase-pentest-skills --skill supabase-report🔴 严重:需要渐进式文件更新
你必须在处理过程中逐步写入上下文文件,而不是只在最后才写。
- 在处理每个部分时立即写入
.sb-pentest-audit.log- 逐步更新
.sb-pentest-context.json中的报告元数据- 切勿等到整个报告生成完毕才更新文件
- 如果技能崩溃或被中断,部分进度必须已经保存
这是强制要求。未能逐步写入是严重错误。
此技能根据所有收集到的发现生成全面的 Markdown 安全审计报告。
.sb-pentest-context.json 中生成的报告包括:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
根据审计发现生成安全报告
将报告生成为 security-audit-2025-01.md
仅生成执行摘要
该技能生成 supabase-audit-report.md:
# Supabase 安全审计报告
**目标:** https://myapp.example.com
**项目:** abc123def.supabase.co
**日期:** January 31, 2025
**审计员:** Internal Security Team
---
## 执行摘要
### 概述
本次安全审计在 Supabase 实现中发现了 **12 个漏洞**,包括 **3 个需要立即关注的关键 (P0)** 问题。
### 关键发现
| 严重性 | 数量 | 状态 |
|----------|-------|--------|
| 🔴 P0 (关键) | 3 | 需要立即采取行动 |
| 🟠 P1 (高) | 4 | 7 天内处理 |
| 🟡 P2 (中) | 5 | 30 天内处理 |
### 安全评分
**评分:35/100 (等级:D)**
该应用程序存在严重的安全漏洞,暴露了用户数据并允许权限提升。在应用程序被视为安全之前,必须解决关键问题。
### 最关键问题
1. **服务角色密钥暴露** — 可能导致完整的数据库访问
2. **数据库备份公开** — 所有数据可下载
3. **管理员功能无身份验证** — 任何用户都可以访问管理员功能
### 建议行动
1. ⚡ **立即 (今天):**
- 轮换服务角色密钥
- 将备份存储桶设为私有
- 添加管理员角色验证
2. 🔜 **本周:**
- 在所有表上启用 RLS
- 启用电子邮件确认
- 修复 Edge Functions 中的 IDOR
3. 📅 **本月:**
- 加强密码策略
- 限制 CORS 来源
- 为函数添加速率限制
---
## 关键发现 (P0)
### P0-001:客户端代码中暴露服务角色密钥
**严重性:** 🔴 关键
**组件:** 密钥管理
**CVSS:** 9.8 (关键)
#### 描述
在客户端 JavaScript 代码中发现了 Supabase service_role 密钥。此密钥会绕过所有行级安全策略,并提供完整的数据库访问权限。
#### 位置
文件:/static/js/admin.chunk.js 行:89 代码:const SUPABASE_KEY = 'eyJhbGciOiJIUzI1NiI...'
#### 影响
- 对所有数据库表的完全读写访问权限
- 绕过所有 RLS 策略
- 访问 auth.users 表(所有用户数据)
- 能够删除或修改任何数据
#### 概念验证
```bash
curl 'https://abc123def.supabase.co/rest/v1/users' \
-H 'apikey: [service_role_key]' \
-H 'Authorization: Bearer [service_role_key]'
# 返回所有用户的完整数据
立即行动:
长期措施:
// 将特权操作移至 Edge Functions
// supabase/functions/admin-action/index.ts
import { createClient } from '@supabase/supabase-js'
Deno.serve(async (req) => {
// 服务密钥仅存在于服务器端
const supabase = createClient(
Deno.env.get('SUPABASE_URL')!,
Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')!
)
// 在继续之前验证调用者是管理员
// ...
})
文档:
严重性: 🔴 关键 组件: 存储 CVSS: 9.1 (关键)
名为 "backups" 的存储桶配置为公开,暴露了数据库转储、用户导出和环境密钥。
| 文件 | 大小 | 内容 |
|---|---|---|
| db-backup-2025-01-30.sql | 125MB | 完整数据库转储 |
| users-export.csv | 2.3MB | 包含 PII 的所有用户数据 |
| secrets.env | 1KB | API 密钥和密码 |
立即行动:
-- 将存储桶设为私有
UPDATE storage.buckets
SET public = false
WHERE name = 'backups';
-- 删除或移动文件
-- 考虑事件响应程序
凭据轮换:
严重性: 🔴 关键 组件: Edge Functions CVSS: 8.8 (高)
/functions/v1/admin-panel Edge Function 可供任何经过身份验证的用户访问,无需角色验证。
[... 其他 P0 发现 ...]
严重性: 🟠 高 组件: 身份验证
[... P1 发现 ...]
严重性: 🟡 中 组件: 身份验证
[... P2 发现 ...]
| 表 | RLS | 访问级别 | 状态 |
|---|---|---|---|
| users | ❌ | 完全读取 | 🔴 P0 |
| orders | ✅ | 无 | ✅ |
| posts | ✅ | 仅已发布 | ✅ |
| 存储桶 | 公开 | 敏感文件 | 状态 |
|---|---|---|---|
| avatars | 是 | 否 | ✅ |
| backups | 是 | 是 (45 个文件) | 🔴 P0 |
| 设置 | 当前 | 推荐 | 状态 |
|---|---|---|---|
| 电子邮件确认 | 禁用 | 启用 | 🟠 P1 |
| 密码最小长度 | 6 | 8+ | 🟡 P2 |
| ID | 行动 | 负责人 | 截止日期 |
|---|---|---|---|
| P0-001 | 轮换服务密钥 | DevOps | 今天 |
| P0-002 | 将备份设为私有 | DevOps | 今天 |
| P0-003 | 添加管理员角色检查 | Backend | 今天 |
| ID | 行动 | 负责人 | 截止日期 |
|---|---|---|---|
| P1-001 | 启用电子邮件确认 | Backend | 3 天 |
| P1-002 | 修复 get-user-data 中的 IDOR | Backend | 3 天 |
| ID | 行动 | 负责人 | 截止日期 |
|---|---|---|---|
| P2-001 | 加强密码策略 | Backend | 14 天 |
| P2-002 | 限制 CORS 来源 | DevOps | 14 天 |
本次审计使用 Supabase 渗透测试技能工具包执行,其中包括:
完整审计日志可在 .sb-pentest-audit.log 中找到
报告由 supabase-pentest-skills 生成 审计完成时间: January 31, 2025 at 15:00 UTC
## 评分计算
安全评分基于以下因素计算:
| 因素 | 权重 | 计算方式 |
|--------|--------|-------------|
| P0 发现 | 每个问题 -25 | 关键漏洞 |
| P1 发现 | 每个问题 -10 | 高严重性问题 |
| P2 发现 | 每个问题 -5 | 中严重性问题 |
| RLS 覆盖率 | 如果 100% 则 +10 | 所有表都有 RLS |
| 身份验证强化 | +10 | 电子邮件确认、强密码 |
| 基础分数 | 100 | 起始点 |
### 等级量表
| 评分 | 等级 | 描述 |
|-------|-------|-------------|
| 90-100 | A | 优秀的安全状况 |
| 80-89 | B | 良好,需要小幅改进 |
| 70-79 | C | 可接受,需要处理问题 |
| 60-69 | D | 差,存在显著问题 |
| 0-59 | F | 关键,需要立即采取行动 |
## 上下文输入
报告生成器从 `.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"
}
生成不含附录的报告
仅生成执行摘要报告
生成 JSON 格式的报告
生成 HTML 格式的报告摘要
⚠️ 此技能需要正确填充的跟踪文件。
在生成报告之前,请确保:
.sb-pentest-context.json 存在并包含来自审计技能的发现.sb-pentest-audit.log 存在并包含带时间戳的操作如果上下文文件缺失或为空:
supabase-pentest 进行完整审计生成报告后,此技能必须:
记录到 .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.json 中的报告元数据:
{ "report": { "generated_at": "...", "filename": "supabase-audit-report.md", "findings_count": { "p0": 3, "p1": 4, "p2": 5 } } }
未能更新上下文文件是不可接受的。
supabase-report-compare — 与之前的报告进行比较supabase-pentest — 首先运行完整审计supabase-help — 列出所有可用技能每周安装次数
94
代码仓库
GitHub 星标数
33
首次出现
Jan 31, 2026
安全审计
安装于
claude-code75
codex68
opencode66
gemini-cli63
github-copilot58
cursor57
🔴 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 skillsWeekly Installs
94
Repository
GitHub Stars
33
First Seen
Jan 31, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykFail
Installed on
claude-code75
codex68
opencode66
gemini-cli63
github-copilot58
cursor57
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
130,600 周安装