Skip to content

All posts

Logged in does not mean allowed in

AI tools build login screens well and permission checks badly. Here is how a signed-in user ends up reading other people's data, and how to test for it.

4 min readvibe coding issues, security, authentication, permissions

Login is the part of an app everyone can see. There is a form, a button, a "welcome back." So it is the part AI tools build carefully and founders test thoroughly.

The part nobody sees is the second question: once someone is in, what are they allowed to do? That one is often missing.

What it looks like in your app

A customer logs in and sees their orders at an address like /orders/1042. They are curious, or bored, and change the number to 1043. They see someone else's order, with that person's name and address.

Or you build an admin page and hide the link from normal users. It works, because normal users never see the button. But the page itself, and the data behind it, will happily answer anyone who types the address.

The name for this is broken access control, and it sits near the top of the standard industry list of web risks.

Why vibe-coded apps end up here

You asked for a login, and you got one. You asked for an admin page, and you got one, with a check in the page that hides the menu item for non-admins. The tool has done what you asked, and the screen behaves.

The catch is where the check lives. A check in the page runs in the visitor's browser, and the visitor controls their browser. Real enforcement has to happen on the server or in the database, every single time data is requested.

AI tools also get the logic wrong in plain ways. In a case reported by The Register in early 2026, an app built on Lovable had a rule written backwards: it blocked signed-in users and let signed-out ones through, exposing about 18,000 user records, according to the researcher. The app looked normal to everyone who used it as intended.

Check it in five minutes

You need two accounts, say yours and a test one.

  1. Sign in as account A. Open a page that shows private data, such as an order, an invoice or a profile, and copy its address.
  2. Sign out, sign in as account B, and paste the address.
  3. You should see an error or nothing. If you see A's data, any signed-in user can read anyone's.
  4. Do the same for the admin pages while signed in as an ordinary user, and while signed out.
  5. Try the same trick on things you can change, not only read: edit or delete something belonging to A while signed in as B.

How to fix it

  • Check ownership on the server, on every request: "does this order belong to the person asking?" Do not rely on hiding things in the page.
  • Where you use a database such as Supabase, put the same rule in the database itself, so even a forgotten server check cannot leak data. (The first post in this series covers how.)
  • Use ids that are hard to guess where you can, but never treat that as the protection. A hard-to-guess address is a locked door with the key under the mat.
  • Keep a short list of roles, such as customer and admin, and check the role on the server for anything privileged.

A prompt: "For every page and API route that returns or changes user data, add a server-side check that the signed-in user owns the record or has the admin role. List each route and the check you added."

Why a second opinion helps

This kind of bug hides because it only shows when you test as the wrong person. A scripted scanner cannot judge it, since it cannot know which records belong to whom, so we test it by hand in every audit. Send us a link and tell us which tool built the app.

Can we watch how you use this site?

We use Microsoft Clarity to see where visitors click and scroll, so we can fix confusing pages. It sets cookies and records your visit. Nothing loads unless you say yes.

Read the privacy notice