eyJ… (JWT)

Exposed Supabase Service-Role Key? Here's how to detect and rotate it

The service_role JWT (eyJ…) bypasses Row-Level Security and owns your whole DB. Scan free with Trust, then replace it with a new secret key in Settings.

The Supabase service_role key is a JWT (starts with eyJ) that BYPASSES Row-Level Security — full read/write to every table, ignoring all your RLS policies. It's meant to live only on your server. If it leaks, an attacker effectively has admin on your database.

What an attacker can do with a leaked Supabase Service-Role Key

How Supabase Service-Role Keys get exposed

Scan your repo and live site for exposed Supabase Service-Role Keys — free

Trust checks your code, git history, and shipped JavaScript. No signup, results in about a minute.

Run a free scan →

How to rotate a leaked Supabase Service-Role Key

  1. Open your project's Dashboard → Settings → API Keys.
  2. Click Create new secret key to generate a modern sb_secret_… key (Supabase now recommends replacing the legacy service_role JWT rather than rotating it in place).
  3. Swap the leaked key for the new secret key in your server env/secrets, then deploy.
  4. Once nothing uses the old key, disable/delete the legacy service_role key from the same page.
  5. Only if you must invalidate the JWT itself: rotating the project's JWT secret invalidates ALL legacy keys and signs out every user — plan for that downtime.
  6. Audit your database and logs for unauthorized changes made while the key was exposed.

Open the Supabase Service-Role Key dashboard →