Skip to content
Back to skills

Supabase Security Audit

ASecurity

Audit Supabase security — RLS policies, exposed secrets, API route auth, storage security, and role grants.

  • 2 stars
  • 0 votes
  • 2 copies
  • 9 views
  • Added October 26, 2026
securitygobashsqlexpressgitapidatabasesecurity

Works with

  • cli
  • api

Security analysis

A100/100

Scanned October 26, 2026

npx -y skills add JoshuaShepherd/my-skills --skill supabase-security-audit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Supabase Security Audit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Supabase Security Audit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/joshuashepherd-supabase-security-audit-my-skills/badge)](https://www.skillsdirectory.com/skills/joshuashepherd-supabase-security-audit-my-skills)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: supabase-security-audit
description: Audit Supabase security — RLS policies, exposed secrets, API route auth, storage security, and role grants.
user-invocable: true
allowed-tools: Read, Grep, Glob, Edit, Bash
---

Run a comprehensive Supabase security audit for the project.

Target: $ARGUMENTS (optional — focus area like "rls", "secrets", "routes")

## Audit Checklist

### 1. Exposed Secrets (Critical)

Search the entire codebase for leaked credentials:

```
SUPABASE_SERVICE_ROLE_KEY
supabase.co (with inline keys)
anon key in client-side code (acceptable only if RLS is enforced)
```

Check:
- `.env` files are gitignored
- No secrets in client-side bundles (src/ should only use anon key)
- Server-side code uses service role key only in `server/` directory
- No secrets committed in git history

### 2. Row Level Security (RLS)

If SQL migrations or schema files exist, check:
- All tables have RLS enabled
- Policies exist for SELECT, INSERT, UPDATE, DELETE as appropriate
- No overly permissive policies (`USING (true)` without justification)
- Auth context is properly used (`auth.uid()`, `auth.role()`)

### 3. API Route Security

Audit all Express routes in `server/`:
- Authentication middleware on protected routes
- Input validation (Zod schemas) on all mutation endpoints
- No direct database access without auth checks
- Rate limiting on sensitive endpoints
- CORS configuration is restrictive

### 4. Client-Side Security

Check `src/` for:
- No direct Supabase client mutations that bypass the API server
- Sensitive operations go through Express API, not direct Supabase calls
- Auth tokens are handled securely (httpOnly cookies preferred over localStorage)

### 5. Storage Security

If Supabase Storage is used:
- Bucket policies restrict access appropriately
- No public buckets containing sensitive data
- Upload size limits enforced
- File type validation on uploads

### 6. Environment Configuration

Check:
- `.env.local` / `.env` are in `.gitignore`
- Server and client environment variables are properly separated
- No `SUPABASE_SERVICE_ROLE_KEY` accessible from client code

## Output Format

```
## Supabase Security Audit

### Critical (exploitable now)
| # | Category | File:Line | Issue | Remediation |
|---|----------|-----------|-------|-------------|

### High (should fix before production)
| # | Category | File:Line | Issue | Remediation |
|---|----------|-----------|-------|-------------|

### Medium (hardening)
| # | Category | File:Line | Issue | Remediation |
|---|----------|-----------|-------|-------------|

### Passed Checks
- ...
```

Apply Critical fixes automatically. Report High and Medium for user review.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.