0xy

0x0b  /hack

The bugs that live in authorization

Authentication asks who you are; authorization asks what you may touch. Most of the serious web bugs that pay out live in the second question. IDOR, broken object-level checks, and the quiet ways an app forgets to ask.

4 min read

#web#authz#idor#bugbounty

Authentication is the lock on the front door: it decides whether you are someone. Authorization is every lock inside: it decides whether you, specifically, may open this drawer. Teams pour effort into the front door — passwords, MFA, session handling — and then wave authenticated users through the interior on trust. That gap is where the findings are. On the public bug-bounty scoreboards, broken access control has sat at or near the top for years, and it is the class a careful beginner can actually find by hand.

Everything below assumes a target you are allowed to test: your own app, a lab box from the home lab, or a program whose published scope covers it. The scope is the authorisation. Outside it there is none.

The shape of the bug#

Almost every access-control flaw is the same sentence: the server trusted the client to only ask for its own things. The request names an object — an id, a filename, an account number — and the server fetches it without checking that the object belongs to the person asking.

http
GET /api/invoices/4815 HTTP/1.1
Cookie: session=<your own valid session>

You are logged in as yourself. The session is real. But is invoice 4815 yours? If the server returns it without asking, that is an IDOR — an insecure direct object reference — and it is the most common serious web bug there is. Change the number, get someone else's data.

How to actually look for it#

The method is boring and it works: use the app normally as one user, watch every request, then tamper with the part that names an object.

  1. Make two accounts. User A and User B, ideally in two browser profiles so the sessions do not collide. You will do everything as A, aiming at B's data.
  2. Catalogue the object references. Browse as A through an intercepting proxy — Burp or mitmproxy. Every id=, every /orders/{n}/, every uuid, every filename in a download link is a candidate. Write them down.
  3. Swap in B's identifiers while still authenticated as A. Take an id that belongs to B and put it in A's request. If A gets B's object back, the check is missing.
  4. Try every verb, not just GET. Reading someone else's record is bad; PUT or DELETE on it is worse. Apps often guard the read path and forget the write path entirely.

The quiet variant is the one people miss: an endpoint that is simply never linked in the UI for your role but answers anyway. The menu hides the button; the route is still live. Never treat an absent link as an enforced permission.

The sibling bugs#

The same "server trusted the client" error wears other clothes:

  • Mass assignment. The signup form sends {name, email}, so you send {name, email, "role":"admin"}. If the model binds every field it receives, you just promoted yourself. Look wherever a request body maps straight onto a database object.
  • Function-level gaps. /admin/* that checks for a logged-in user but not an admin user. Request the admin endpoint with an ordinary session and see what comes back.
  • Guessable identifiers. Sequential integer ids turn one IDOR into a scrape — 1, 2, 3, walk the whole table. UUIDs do not fix a missing check, but they stop enumeration when the check is also fixed. Both matter.
  • Trusting a hidden field. price, account_id, is_verified shipped to the client and sent back are suggestions, not facts. The client holds nothing the server should believe.

The token says more than people think#

Where the app uses a JWT, read it — the payload is just base64, not encryption. Decode it with jwt.io or cut -d. -f2 | base64 -d. Two classic failures live here: a server that accepts "alg":"none" and skips signature checking entirely, and claims like "user":"a" the client could swap if the signature is not actually verified. A JWT is signed data, not secret data; what it grants still has to be checked server-side on every request.

Why it keeps happening#

Access control cannot be centralised the way authentication can. There is one login, but there are thousands of objects and actions, and each one needs its own "does this person own this?" check, written by hand, in the right place, every time. Miss one endpoint out of hundreds and the app still looks completely normal — until someone increments an id. That asymmetry is the whole game: the defender has to get it right everywhere, and the tester only has to find the one place it was forgotten.

Writing it up#

A good access-control report is short and devastating: two accounts, the exact request, the response proving A read B's data, and the business impact in one line ("any user can read any other user's invoices"). No exploit chain needed — the swapped id is the proof. That clarity is also why these bugs get fixed fast: there is nothing to argue about.