PeekLok

Exposed anon or service role key

Supabase gives you two kinds of keys. The anon (publishable) key is meant to be public and is only safe when RLS is on. The service role (secret) key skips every rule and must never reach the browser.

Free scan: check my app Just your web address. Results in seconds. No signup, no card.

What can go wrong

If the service role key is in your front-end code, anyone can read, change or delete everything in your database. If the anon key is public and RLS is off, the result is nearly as bad.

How to check

  1. Open your live site, press F12, and search the Sources or Network tab for “service_role” or “sb_secret”.
  2. Search your project code for the service role key.
  3. If you find it in front-end code, rotate it in Supabase straight away.

What PeekLok’s scan checks

PeekLok’s scan looks through your page and the scripts it loads from your site for Supabase keys. It tells you if a service role key is showing, and if the anon key is there it uses it to test which tables anyone can read.

General fix prompt

Find every place the Supabase service role key is used. Move all of them into a server-side function and read the key from a secret setting, never from front-end code. Only the anon (publishable) key may appear in the browser. Then tell me to rotate the service role key in the Supabase dashboard.

Builder-specific guides

Sources

Get a free scan

PeekLok checks your live app for secret keys in the page code, a Supabase service or anon key showing, Supabase tables anyone can read with the public key, and five browser security headers. If your app uses Supabase login, you can add two test logins and it checks whether one user can see the other’s data. Only scan apps you own. First scan free. Weekly re-checks will be $12 US a month once payments open.

Start my free scan