Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
yoanbernabeu avatar

Supabase Extract Anon Key

  • 325 installs
  • 60 repo stars
  • Updated January 31, 2026
  • yoanbernabeu/supabase-pentest-skills

supabase-extract-anon-key is a Claude security skill that extracts the Supabase anonymous public API key from client-side code and verifies it is the anon key—not the privileged service key—for developers running pre-shi

About

supabase-extract-anon-key is a Claude skill from yoanbernabeu/supabase-pentest-skills that scans client-side code to extract the Supabase anon/public API key expected in frontend apps. The skill confirms the discovered credential is the anon key and not the privileged service_role secret, supporting Row Level Security testing before production deploys. Findings write progressively to .sb-pentest-context.json and .sb-pentest-audit.log after each discovery so interrupted runs retain state. Developers reach for supabase-extract-anon-key during Supabase pentest workflows when validating credential segregation in React, Next.js, or other client bundles. It is the first step in confirming public keys are correctly scoped for RLS validation.

  • Extracts Supabase anon key from client-side code
  • Verifies only the public key is exposed, not the service key
  • Prepares credentials for subsequent API audit steps
  • Part of supabase-pentest-skills suite

Supabase Extract Anon Key by the numbers

  • 325 all-time installs (skills.sh)
  • +14 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #608 of 2,203 Security skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/yoanbernabeu/supabase-pentest-skills --skill supabase-extract-anon-key

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs325
repo stars60
Last updatedJanuary 31, 2026
Repositoryyoanbernabeu/supabase-pentest-skills

How do you find the Supabase anon key in client code?

Extracts the Supabase anonymous (public) API key from client-side code and verifies it is the anon key — not the privileged service key — to confirm correct credential segregation.

Who is it for?

Developers pentesting Supabase apps who need to locate the anon key in client bundles and confirm it is not a leaked service_role credential.

Skip if: Server-side-only Supabase setups with no client-exposed keys, or projects not using Supabase authentication at all.

When should I use this skill?

A Supabase pentest needs the anon/public key extracted from client-side code for RLS testing or credential segregation verification.

What you get

Extracted anon API key, credential-type verification result, .sb-pentest-context.json entries, and .sb-pentest-audit.log audit trail.

  • .sb-pentest-context.json findings
  • .sb-pentest-audit.log audit trail

By the numbers

  • Writes progressively to .sb-pentest-context.json and .sb-pentest-audit.log

Files

SKILL.mdMarkdownGitHub ↗

Supabase Anon Key Extraction

🔴 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 discovery
- 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 extracts the Supabase anonymous (public) API key from client-side code.

When to Use This Skill

  • After extracting the Supabase URL, to get the API key for testing
  • To verify that only the anon key (not service key) is exposed
  • Before running API audit skills that require authentication

Prerequisites

  • Supabase URL extracted (or will auto-invoke supabase-extract-url)
  • Target application accessible

Understanding Anon Keys

The anon key (also called public key) is:

  • Expected to be in client-side code
  • Safe when RLS (Row Level Security) is properly configured
  • ⚠️ Risky if RLS is missing or misconfigured
  • Not the same as the service_role key (which should NEVER be in client code)

Key Format

Supabase anon keys are JWTs:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFiYzEyMyIsInJvbGUiOiJhbm9uIiwiaWF0IjoxNjQwMDAwMDAwLCJleHAiOjE5NTUzNjAwMDB9.xxxx

Key characteristics:

  • Starts with eyJ (base64 encoded {"alg":)
  • Contains "role":"anon" in payload
  • Project reference in "ref" claim

Extraction Patterns

The skill searches for:

1. Direct Key Assignment

const SUPABASE_KEY = 'eyJhbGci...'
const SUPABASE_ANON_KEY = 'eyJhbGci...'

2. Client Initialization

createClient(url, 'eyJhbGci...')
createClient(url, process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY)

3. Environment Variable Patterns

NEXT_PUBLIC_SUPABASE_ANON_KEY
VITE_SUPABASE_ANON_KEY
REACT_APP_SUPABASE_KEY
SUPABASE_KEY

Usage

Basic Extraction

Extract Supabase anon key from https://myapp.example.com

If URL Already Known

Extract anon key for project abc123def

Output Format

═══════════════════════════════════════════════════════════
 ANON KEY EXTRACTED
═══════════════════════════════════════════════════════════

 Key Type: anon (public)
 Severity: ℹ️  Expected (verify RLS configuration)

 Key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJz
      dXBhYmFzZSIsInJlZiI6ImFiYzEyM2RlZiIsInJvbGUiOiJhbm
      9uIiwiaWF0IjoxNjQwMDAwMDAwLCJleHAiOjE5NTUzNjAwMDB9
      .xxxxxxxxxxxxx

 Decoded Payload:
 ├── iss: supabase
 ├── ref: abc123def
 ├── role: anon
 ├── iat: 2021-12-20T00:00:00Z
 └── exp: 2031-12-20T00:00:00Z

 Found in:
 └── /static/js/main.js (line 1253)
     createClient('https://abc123def.supabase.co', 'eyJhbGci...')

 Next Steps:
 ├── Run supabase-audit-rls to test if RLS protects your data
 ├── Run supabase-audit-tables-read to see what's accessible
 └── Run supabase-extract-service-key to check for critical leaks

 Context updated: .sb-pentest-context.json
═══════════════════════════════════════════════════════════

Key Validation

The skill validates the extracted key:

Validation:
├── Format: ✅ Valid JWT structure
├── Decode: ✅ Payload readable
├── Role: ✅ Confirmed "anon" role
├── Project: ✅ Matches extracted URL (abc123def)
└── Expiry: ✅ Not expired (expires 2031-12-20)

Multiple Keys

If multiple keys are found:

═══════════════════════════════════════════════════════════
 MULTIPLE KEYS FOUND
═══════════════════════════════════════════════════════════

 ⚠️  2 potential Supabase keys detected

 1. Anon Key (confirmed)
    └── Role: anon, Project: abc123def

 2. Unknown Key
    └── Role: service_role ⚠️  SEE supabase-extract-service-key
        This may be a CRITICAL security issue!

═══════════════════════════════════════════════════════════

Context Output

Saved to .sb-pentest-context.json:

{
  "supabase": {
    "anon_key": "eyJhbGci...",
    "anon_key_decoded": {
      "iss": "supabase",
      "ref": "abc123def",
      "role": "anon",
      "iat": 1640000000,
      "exp": 1955360000
    },
    "anon_key_sources": [
      {
        "file": "/static/js/main.js",
        "line": 1253
      }
    ]
  }
}

Security Assessment

FindingSeverityDescription
Anon key in clientℹ️ InfoExpected, but test RLS
Anon key expired⚠️ P2Key should be rotated
Multiple anon keys⚠️ P2May indicate key rotation issues
Role is not "anon"🔴 P0Wrong key type exposed!

Common Issues

Problem: Key found but won't decode ✅ Solution: May be obfuscated or split. Try:

Extract anon key with deobfuscation from https://myapp.example.com

Problem: Key doesn't match URL project ✅ Solution: App may use multiple Supabase projects. Both keys are recorded.

Problem: No key found but Supabase detected ✅ Solution: Key may be fetched at runtime. Check network requests:

Monitor network for anon key on https://myapp.example.com

Best Practices Reminder

For developers reading this report:

1. Anon key in client is normal — It's designed for this 2. RLS is critical — The anon key relies on RLS for security 3. Never use service_role in client — Use Edge Functions instead 4. Rotate keys periodically — Available in Supabase Dashboard

MANDATORY: Progressive Context File Updates

⚠️ This skill MUST update tracking files PROGRESSIVELY during execution, NOT just at the end.

Critical Rule: Write As You Go

DO NOT batch all writes at the end. Instead:

1. Before starting any action → Log the action to .sb-pentest-audit.log 2. After each discovery → Immediately update .sb-pentest-context.json 3. After each significant step → Log completion to .sb-pentest-audit.log

This ensures that if the skill is interrupted, crashes, or times out, all findings up to that point are preserved.

Required Actions (Progressive)

1. Update `.sb-pentest-context.json` with extracted data:

   {
     "supabase": {
       "anon_key": "eyJhbGci...",
       "anon_key_decoded": { ... },
       "anon_key_sources": [ ... ]
     }
   }

2. Log to `.sb-pentest-audit.log`:

   [TIMESTAMP] [supabase-extract-anon-key] [START] Beginning anon key extraction
   [TIMESTAMP] [supabase-extract-anon-key] [SUCCESS] Anon key extracted
   [TIMESTAMP] [supabase-extract-anon-key] [CONTEXT_UPDATED] .sb-pentest-context.json updated

3. If files don't exist, create them before writing.

FAILURE TO UPDATE CONTEXT FILES IS NOT ACCEPTABLE.

MANDATORY: Evidence Collection

📁 Evidence Directory: .sb-pentest-evidence/02-extraction/

Evidence Files to Create

FileContent
extracted-anon-key.jsonAnon key with decoded JWT payload

Evidence Format

{
  "evidence_id": "EXT-ANON-001",
  "timestamp": "2025-01-31T10:07:00Z",
  "category": "extraction",
  "type": "anon_key",
  "severity": "info",

  "key_data": {
    "key_prefix": "eyJhbGciOiJIUzI1NiI...",
    "key_suffix": "...xxxx",
    "full_key_length": 256
  },

  "decoded_payload": {
    "iss": "supabase",
    "ref": "abc123def",
    "role": "anon",
    "iat": "2021-12-20T00:00:00Z",
    "exp": "2031-12-20T00:00:00Z"
  },

  "source": {
    "file": "/static/js/main.js",
    "line": 1253,
    "context": "createClient('https://abc123def.supabase.co', 'eyJhbGci...')"
  },

  "validation": {
    "format_valid": true,
    "role_confirmed": "anon",
    "project_matches": true,
    "expired": false
  }
}

Related Skills

  • supabase-extract-url — Get URL first (auto-invoked if needed)
  • supabase-extract-service-key — Check for critical service key leak
  • supabase-audit-rls — Test if RLS protects your data
  • supabase-audit-tables-read — See what data is accessible with this key

Related skills

FAQ

What files does supabase-extract-anon-key update?

supabase-extract-anon-key writes findings progressively to .sb-pentest-context.json after each discovery and logs actions to .sb-pentest-audit.log before and after each step, so interrupted pentest runs retain prior results.

Why extract the Supabase anon key during pentesting?

supabase-extract-anon-key locates the anon/public key expected in client apps and confirms it is not the service_role secret. Developers use the extracted anon key for Row Level Security testing with correctly scoped public credentials.

Securitysecretsauditappsec

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.