supabase-audit-authenticated
Create a test user (with explicit permission) to audit what authenticated users can access vs anonymous users. Detects IDOR, cross-user access, and privilege escalation.
What this skill does
# Authenticated User 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 test** > - Log to `.sb-pentest-audit.log` **BEFORE and AFTER each action** > - **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 creates a test user (with explicit permission) to compare authenticated vs anonymous access and detect IDOR vulnerabilities. ## โ ๏ธ IMPORTANT: User Consent Required ``` โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ ๐ USER CREATION CONSENT REQUIRED โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ โ โ โ This skill will CREATE A TEST USER in your Supabase project. โ โ โ โ The user will be created with: โ โ โข Email: pentest-[random]@security-audit.local โ โ โข Password: Strong random password (32+ chars) โ โ โข Purpose: Testing authenticated access vs anonymous โ โ โ โ At the end of the audit, you will be asked if you want to โ โ DELETE the test user (recommended). โ โ โ โ Do you authorize the creation of a test user? โ โ Type "yes, create test user" to proceed. โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ``` **DO NOT proceed without explicit user consent.** ## When to Use This Skill - After completing anonymous access tests - To detect IDOR (Insecure Direct Object Reference) vulnerabilities - To test cross-user data access - To verify RLS policies work for authenticated users - To find privilege escalation issues ## Prerequisites - Signup must be open (or use invite flow) - Anon key available - Anonymous audit completed (recommended) ## Why Authenticated Testing Matters Many vulnerabilities only appear with authentication: | Vulnerability | Anonymous | Authenticated | |---------------|-----------|---------------| | **RLS bypass (no RLS)** | โ Detectable | โ Detectable | | **IDOR** | โ Not visible | โ **Only visible** | | **Cross-user access** | โ Not visible | โ **Only visible** | | **Privilege escalation** | โ Not visible | โ **Only visible** | | **Overly permissive RLS** | Partial | โ **Full detection** | ## Test User Creation ### Email Format ``` pentest-[8-char-random]@security-audit.local ``` Example: `[email protected]` ### Password Generation Strong password with: - 32+ characters - Uppercase, lowercase, numbers, symbols - Cryptographically random Example: `Xk9$mP2#vL5@nQ8&jR4*wY7!hT3%bU6^` **The password is displayed ONCE and saved to evidence.** ## Tests Performed ### 1. User Creation & Login ```bash # Create user curl -X POST "$SUPABASE_URL/auth/v1/signup" \ -H "apikey: $ANON_KEY" \ -H "Content-Type: application/json" \ -d '{"email": "[email protected]", "password": "[STRONG_PASSWORD]"}' # Login and get JWT curl -X POST "$SUPABASE_URL/auth/v1/token?grant_type=password" \ -H "apikey: $ANON_KEY" \ -H "Content-Type: application/json" \ -d '{"email": "[email protected]", "password": "[STRONG_PASSWORD]"}' ``` ### 2. Authenticated vs Anonymous Comparison For each table: | Test | Anonymous | Authenticated | Finding | |------|-----------|---------------|---------| | SELECT | 0 rows | 1,247 rows | ๐ด Auth-only exposure | | Own data | N/A | Only own row | โ RLS working | | Other users' data | N/A | All rows | ๐ด Cross-user access | ### 3. IDOR Testing ```bash # As test user, try to access other user's data curl "$SUPABASE_URL/rest/v1/orders?user_id=eq.[OTHER_USER_ID]" \ -H "apikey: $ANON_KEY" \ -H "Authorization: Bearer [TEST_USER_JWT]" # If returns data: IDOR vulnerability! ``` ### 4. Cross-User Access ```bash # Get test user's ID from JWT TEST_USER_ID=$(echo $JWT | jq -r '.sub') # Try to access data belonging to a different user curl "$SUPABASE_URL/rest/v1/profiles?id=neq.$TEST_USER_ID" \ -H "Authorization: Bearer [TEST_USER_JWT]" # If returns other users' profiles: Cross-user access! ``` ### 5. Storage with Authentication ```bash # Test authenticated storage access curl "$SUPABASE_URL/storage/v1/object/list/documents" \ -H "apikey: $ANON_KEY" \ -H "Authorization: Bearer [TEST_USER_JWT]" # Compare with anonymous results ``` ### 6. Realtime with Authentication ```javascript // Subscribe to table changes as authenticated user const channel = supabase.channel('test') .on('postgres_changes', { event: '*', schema: 'public', table: 'orders' }, payload => console.log(payload)) .subscribe() // Does it receive OTHER users' order changes? ``` ## Output Format ``` โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ AUTHENTICATED USER AUDIT โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Test User Creation โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Status: โ User created successfully Test User Details: โโโ Email: [email protected] โโโ User ID: 550e8400-e29b-41d4-a716-446655440099 โโโ Password: [Saved to evidence - shown once] โโโ JWT obtained: โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Anonymous vs Authenticated Comparison โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Table: users โโโ Anonymous access: 0 rows โโโ Authenticated access: 1,247 rows โ ALL USERS! โโโ Status: ๐ด P0 - Data hidden from anon but exposed to any auth user Table: orders โโโ Anonymous access: 0 rows (blocked) โโโ Authenticated access: 1 row (own orders only) โโโ Status: โ RLS working correctly Table: profiles โโโ Anonymous access: 0 rows โโโ Authenticated access: 1,247 rows โ ALL PROFILES! โโโ Own profile only expected: โ NO โโโ Status: ๐ด P0 - Cross-user profile access โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ IDOR Testing โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Test: Access other user's orders by ID โโโ Request: GET /orders?user_id=eq.[other-user-id] โโโ Auth: Test user JWT โโโ Response: 200 OK - 15 orders returned โโโ Status: ๐ด P0 - IDOR VULNERABILITY Proof: curl "$URL/rest/v1/orders?user_id=eq.other-user-uuid" \ -H "Authorization: Bearer [test-user-jwt]" # Returns orders belonging to other-user-uuid! Test: Access admin endpoints โโโ Request: GET /functions/v1/admin-panel โโโ Auth: Test user JWT (regular user) โโโ Response: 200 OK - Admin data returned! โโโ Status: ๐ด P0 - PRIVILEGE ESCALATION โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Storage with Authentication โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Bucket: documents โโโ Anonymous: โ 0 files (blocked) โโโ Authenticated: โ 523 files visible โ ALL USERS' FILES! โโโ Status: ๐ด P1 - Auth users see all documents Bucket: user-uploads โโโ Anonymous: โ 0 files โโโ Authenticated: 3 files (own files only) โโโ Status: โ RLS working correctly โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Summary โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ New Findings (Auth-only): โโโ ๐ด P0: users table - all users visible to any auth user โโโ ๐ด P0: profiles table - cross-user access โโโ ๐ด P0: IDOR in orders - can access any user's orders โโโ ๐ด P0: Privilege escalation in admin-panel โโโ ๐ P1:
Related in Security
mac-ops
IncludedComprehensive macOS workstation operations โ diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.