Free tool · runs in your browser

Who can call your Edge Function?

Paste a Supabase Edge Function. Your browser reads the code and flags what lets a stranger use it: the service role key with no check on who is calling, a Stripe webhook that never checks Stripe’s signature, a user id taken from the request body, keys written into the file. Each one comes with the line, the fix and a prompt for your AI builder. Nothing you paste leaves this page.

No upload, no network request TypeScript or JavaScript, Deno Keys masked in the result Nothing to paste?

Why functions matter

The function’s URL is public. Its code is the only lock.

Every Edge Function answers at https://<project>.supabase.co/functions/v1/<name>, and the name is in the JavaScript your app ships. Anyone can call it with any headers and any body, without opening your app.

Functions are also where the service role key lives, and that key skips every row level security policy. So a function that uses it is your access rule. If it never asks who is calling, your database rules are off for whoever finds the URL.

The function…Who can use it
uses the service role key, never checks the calleranyone Every row, every table, no policy applies.
handles Stripe events without checking the signatureanyone A fake “paid” event unlocks what customers pay for.
reads user_id from the bodyany account Send someone else’s id, act on their account.
calls getUser and uses user.idthe owner What you want.

What it looks for

The function mistakes AI builders write most.

The check reads the code line by line, skips comments, and looks at the function as a whole: a service role key is fine after a caller check, a signature check or a shared secret, and only flagged without one.

PatternWhat it meansSeverity
Service role with no caller checkThe admin key is used and nothing checks who is calling: no getUser, no signature, no shared secret. PL‑017critical
Unsigned Stripe webhookStripe events handled without constructEventAsync. Also flags the sync constructEvent, which throws in Deno, and a body parsed as JSON before the check. PL‑021critical or medium
Key written in the codeStripe, OpenAI, Anthropic, Resend and Supabase secret keys, and service_role JWTs (decoded, so the public anon key isn’t flagged). PL‑009critical
User id from the requestuser_id, userId, owner_id and similar read from the body or query string instead of the signed-in user. PL‑022high
SQL built from inputValues pasted into query text for a direct Postgres connection. The tagged sql`…` form of postgres.js is safe and not flagged.high
verify_jwt off, no checkThe platform check is switched off in config.toml and the code doesn’t check anything either.high
.or() filter from inputA search term pasted into an .or() filter string can add conditions of its own.medium
CORS echoes any originThe request’s Origin sent back with Allow-Credentials: true. Plain * with bearer tokens isn’t flagged. PL‑026medium

Questions

About the Edge Function check

Something else? Email the founder.

Where do I find my function’s code?

In your repo at supabase/functions/<name>/index.ts. If you built with Lovable or Bolt, open the code view and look for the supabase/functions folder. In the Supabase dashboard, Edge Functions lists each function and shows its code. Paste one function at a time.

Is it safe to paste code with keys in it?

The check is a script on this page. It makes no network request and stores nothing, and keys are masked in the result. Open your browser’s developer tools, go to the Network tab, and run a check to see for yourself. If it finds a key, rotate it anyway: it has been in your code.

Isn’t verify_jwt enough?

No. On projects with legacy keys, the platform check accepts any valid project JWT, and your public anon key is one. It stops nobody who has opened your app. Check the caller in the code with supabase.auth.getUser(token) and use the id it returns. The Edge Function guide walks through it.

Nothing flagged. Am I safe?

None of the risky patterns appear in what you pasted. This is a reading of the code, not a test of your deployed function, so logic it can’t see (an admin check that reads the wrong field, say) can still be wrong. Call the function yourself with no token and with a second account’s token to confirm.

Does the full check cover functions?

Yes. The full PatchLabs check reads every function in your repo with these rules and more, scans the whole git history for keys, and rebuilds your database to test your RLS policies as three people. Your first app is free.

The full check

Check every function, your keys and your database rules, free.

The full check scans your code and full git history for keys, rebuilds your Supabase database in our lab, tests it as three identities, writes the fix and proves it works. First app free, fixes included.