← Reference

A hidden button is not a permission

The most common serious flaw in AI-built admin areas.

01

What goes wrong

You ask for an admin area. Your AI tool produces {user.isAdmin && <AdminPanel />}, which is correct for hiding the interface and does nothing for access control. Anyone can open developer tools, set isAdmin to true, and the panel appears.

Whether that matters depends entirely on whether the server checks again. If it does, they see an admin interface that returns errors. If it does not, they have admin access.

02

What to check

For every action behind a role check, find the server-side code that runs it and confirm it independently verifies the role. Not the request body, not a header the client set — the role as stored in your database for the authenticated user.

With Supabase, that means a row-level security policy that reads the role from a table, and not a filter added in the client query.

03

Paid plans too

The same applies to plan === "pro" checks. A plan gate in the browser is a suggestion. If a premium feature calls an endpoint, that endpoint has to check the subscription itself.

Not sure whether this applies to you?

Give us the address and we will tell you. No code, no access, no install — and every finding we have is shown in full, including on the free trial.

Check a site