Home
Cybersecurity & AI Security / Part 19 — Broken Access Control and IDOR

Broken Access Control and IDOR

CAP, ACID vs BASE, latency numbers, back-of-envelope estimation, single points of failure — the vocabulary every system designer thinks in.


Core Philosophy: Authentication proves who you are; authorization decides what you’re allowed to do. Broken access control is the failure of that second check — the application correctly knows who you are, then fails to verify that this user may access this resource or this action. It is consistently among the most widespread and most damaging vulnerability categories in the entire industry, and — good news for you — it’s often found without any special tools at all.

Part 1: The Problem

Recall the airport analogy from 1.4: authentication is showing your passport; authorization is your boarding pass deciding which flight and seat you may board. Broken access control is being correctly identified at security, then walking onto any plane you like because nobody checks the boarding pass.

In application terms: you log in successfully (authentication works), but then the app fails to properly enforce what you specifically are allowed to see and do. You access another user’s data. You reach an admin function. You perform an action meant for someone else.

It is enormously common — it has ranked at or near the top of the OWASP Top 10 — for a simple reason: every single resource and every single action in an app needs a correct permission check, and missing even one creates the hole. It’s also a favourite of bug bounty hunters because the bugs are high-impact and frequently require nothing more than changing a value in a request.

Part 2: The Concept — IDOR (Insecure Direct Object Reference)

The most classic broken-access-control bug is the IDOR. The name sounds technical; the idea is simple.

Applications refer to things — invoices, profiles, messages, files — by identifiers, often in the URL or in request parameters:

text
   /invoice?id=4012
   /user/3375/profile
   /api/messages/88291
   /download?file=report_204.pdf

An IDOR exists when the app uses that identifier to fetch the object but never checks that the requesting user is allowed to access that object. So the attacker simply changes the identifier:

text
   You are logged in. You view YOUR invoice:
        /invoice?id=4012        ✓ your invoice

   You change the number:
        /invoice?id=4011        ← someone else's invoice
        /invoice?id=4013        ← another person's invoice

   If the app shows them to you, that is an IDOR.
   It fetched the object by ID and never asked
   "is this user allowed to see object 4011?"

That’s it. The “attack” can be as trivial as editing a number in a URL. Yet the impact can be enormous — every user’s invoices, every user’s personal data, every user’s private messages, just by walking the IDs.

Part 3: The Forms of Broken Access Control

IDOR is the famous example, but broken access control is a broader family. The main forms:

Horizontal access control failure. Accessing the data of another user at your same privilege level — one regular user reading another regular user’s data. IDOR is usually this.

Vertical access control failure (privilege escalation). Accessing functionality of a higher privilege level — a normal user reaching admin-only functions.

text
   HORIZONTAL                    VERTICAL
   user A ──► user B's data      normal user ──► admin functions
   (same privilege level)        (higher privilege level)

Forced browsing. Directly requesting a URL you were never shown but which isn’t properly protected — e.g. navigating straight to /admin/dashboard. The app “hid” the link but didn’t actually protect the page. (Hiding is not access control.)

Missing function-level access control. The app checks permissions on the page but not on the underlying actions/APIs. The admin page is protected, but the admin API endpoint it calls is not — so an attacker calls the API directly.

Parameter / metadata tampering. Changing a value that the app trusts to make access decisions — e.g. a request containing role=user that the attacker changes to role=admin, or a hidden field, or a cookie value, that the server trusts instead of verifying server-side.

The common thread in every form: the app failed to properly verify, on the server, that this specific user is authorized for this specific resource or action.

Part 4: Why It Happens — The Root Causes

Understanding why broken access control is so common makes you better at finding it and, later, fixing it.

This is also why insecure design (an OWASP category) and broken access control are linked — robust access control has to be designed in and enforced consistently, not sprinkled around ad hoc. You’ll see the design-level fix in Phase 4.3.

Part 5: Finding Broken Access Control

This category rewards methodical testing, and you already have the tools (Burp, from 2.2). The approach:

text
1. MAP ROLES      Identify the privilege levels: anonymous,
                     regular user, admin, etc.
2. USE TWO        Create two accounts (e.g. User A and User B).
   ACCOUNTS          This is the key technique for horizontal
                     access-control testing.
3. CATALOGUE      As User A, browse the whole app. Note every
                     identifier, endpoint, and action.
4. CROSS-ACCESS   As User B, try to access User A's objects
                     (swap IDs). Try to reach admin functions
                     as a normal user. Try forced browsing to
                     unlinked pages.
5. TAMPER         Modify parameters, hidden fields, cookies,
                     and roles in requests — see what the server
                     trusts that it shouldn't.
6. TEST THE API   Check whether underlying API endpoints enforce
                     the same controls as the pages.

The two-account technique is the heart of it: log in as User B, capture a request, then swap in identifiers belonging to User A. If User A’s data comes back, you’ve found an IDOR. Burp’s Repeater makes this swap-and-resend loop fast.

⚖️ Ethics — critically important here. Broken access control means you can reach other people’s real data. On any target with real users — especially a bug bounty target — stop the instant you’ve proven access is possible. Confirm with the minimum — ideally your own second test account, or one record, enough to demonstrate the flaw. Do not enumerate through real users’ data “to show impact.” Reading other people’s personal data is a serious crime and a serious harm, in-scope program or not. Prove it; never pillage it. This is page 1.0 at its most important.

Part 6: A Glance at the Fix

The fix is conceptually simple and operationally demanding (built fully in Phase 4.2 / 4.3):

text
   VULNERABLE:  fetch invoice by the ID in the request,
                return it.   ← no permission check

   SAFE:        fetch invoice by ID, THEN verify the
                logged-in user owns/may access it,
                THEN return it — else DENY.

📓 Key Terms

Term Plain meaning
Access control / authorizationEnforcing what an authenticated user may access/do.
Broken access controlFailure to properly enforce those permissions.
IDORInsecure Direct Object Reference — accessing objects by changing an identifier, with no ownership check.
Horizontal access failureAccessing another user’s data at the same privilege level.
Vertical access failureAccessing higher-privilege (e.g. admin) functionality.
Privilege escalationGaining permissions above your own.
Forced browsingDirectly requesting unlinked-but-unprotected URLs.
Parameter tamperingChanging a trusted value (role, ID, hidden field) to gain access.
Deny by defaultAccess is denied unless explicitly granted — so omissions fail safe.
Security through obscurityRelying on secrecy/hard-to-guess values instead of a real control — not sufficient.

🧪 Hands-On Lab

Only on your own lab or deliberately vulnerable practice apps. Accessing other people’s real data on any unauthorized system is a serious crime — and a serious harm.

Task 1 — Find your first IDOR. On a deliberately vulnerable app, find a feature using an identifier in the URL or a parameter (an invoice, a profile, a document). Change the identifier. If you see another “user’s” data, you’ve found an IDOR. Note how little it took.

Task 2 — Practice the two-account technique. Create two accounts in the practice app. As User B, capture a request for User B’s own data in Burp. In Repeater, swap in User A’s identifier. Does User A’s data return? This is the core professional method for access-control testing.

Task 3 — Vertical escalation. As a normal user in the practice app, try to reach admin functionality — guess admin URLs (forced browsing), or call admin API endpoints directly. See whether “normal user” is actually enforced or merely assumed.

Task 4 — Parameter tampering. Find a request containing a role, a privilege flag, a price, or a hidden field. Modify it in Burp (e.g. role=user → role=admin). See whether the server trusts your modified value instead of verifying server-side.

Task 5 — Page vs API. Find a protected admin page. Identify the API endpoint it uses. Call that endpoint directly as a normal user. This tests for missing function-level access control — a very common real-world gap.

Task 6 — Write it up properly. For one IDOR you found, write a short, professional finding: what the flaw is, the exact reproduction steps, the impact, and the fix from Part 6. This is real bug-report practice (developed fully in Phase 5A.4).

⚠️ Common Mistakes

✅ Recap & What’s Next

Next (2.8): We look at attacks that abuse trust in requests themselves — tricking a browser, or a server, into making requests it never should: CSRF and SSRF.

⁂ Back to all modules