Skip to content
Tutorials Center
My learning

Topics

Lesson 30 of 38 ยท Common Vulnerability Workflows

Access Control and IDOR Testing in Burp

Learn to test broken access control: horizontal and vertical privilege checks, IDOR with two test accounts, method and path tricks, and a Python model of an authorisation matrix.

Broken access control is the number one risk on the OWASP Top 10, and scanners are poor at finding it. A scanner cannot know that user A should not see user B's invoice, because that rule lives in the business, not in the protocol. This is where a human with Burp does the best work: you supply the knowledge of who may do what, and Burp supplies the replay.

The Burp screens are labelled example output. The Python blocks model the logic offline. Use only test accounts you were given or created on a system you are authorised to test.

The vocabulary

  • Authentication establishes who you are. Authorisation decides what you may do. Access control bugs are authorisation bugs.
  • Horizontal escalation: reaching another user's data at the same privilege level (customer A reads customer B's order).
  • Vertical escalation: reaching functions of a higher role (a normal user calls an admin endpoint).
  • IDOR (insecure direct object reference): the app uses an identifier from the request (/orders/1001) and returns the object without checking that the caller owns it.
  • Function-level access control: hidden admin URLs protected only by being unlinked.

Prepare: two accounts and a role matrix

You need at least two accounts of the same role (for horizontal tests) and one of each higher role you can get (for vertical tests). Write a small matrix of expected behaviour before testing:

Resource / action Anonymous User A User B Admin
View own order deny allow allow allow
View A's order deny allow deny allow
Edit A's profile deny allow deny allow
Open /admin/users deny deny deny allow

Every bold deny is a test case. If the application allows one, you have a finding.

The core technique: replay with another session

  1. Log in as User A (in one browser or Burp's built-in browser) and perform the action, so the request appears in Proxy history.
  2. Send it to Repeater. Copy the session cookie of User B into the request (or use a second Repeater tab with B's cookie).
  3. Send. If B receives A's data or performs A's action, access control is broken.
  4. Repeat the same request with no session at all (anonymous).

You can also keep User A's session and change the identifier (orderId=1001 to 1002, a UUID taken from B's account).

TEXT
Example (labelled): Repeater, session of user B requesting A's order
GET /api/orders/1001 HTTP/1.1
Cookie: sid=<B's session>

HTTP/1.1 200 OK
{"id":1001,"owner":"alice","total":"118.40","address":"..."}
Verdict: B can read A's order -> horizontal access control failure (IDOR)

Testing at scale: Autorize-style extensions

Replaying each request by hand is slow. BApp Store extensions (for example the family of "Autorize"-style tools) take every request you make as User A, automatically replay it with User B's cookie and with no cookie, and compare the responses with colour coding: bypassed, enforced or "is it enforced?". You drive the application as the high-privileged user, and the extension tests everyone else. Check each "bypassed" result manually, because a 200 response can still be an error page.

Model the check in Python

This stand-in models an app with a missing ownership check and one with a correct check, then runs the same A-and-B test matrix against both. Everything is local and fake.

Python Authorisation matrix against two implementations (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Read the output: the vulnerable version fails exactly the "bob reads alice's order" row. In a report, that single row, with the real request and response, is the finding.

Where else to look

  • Identifiers everywhere: URLs, query strings, JSON bodies, hidden form fields, cookies, headers. Also in PUT, DELETE and PATCH requests, which are often less protected than GET.
  • Predictable vs random IDs: sequential numbers make enumeration easy, but random UUIDs do not fix IDOR; the check is still missing. UUIDs only slow guessing.
  • HTTP methods: if GET /admin/delete is blocked, try POST, and if only POST is checked, try PUT. Check what OPTIONS allows.
  • Path variations: /admin vs /admin/, case changes, double slashes, /%2e/admin can bypass frontend or proxy rules that match path text. These are finding the mismatch between layers checks.
  • Mass assignment: does the API accept extra JSON fields you were not meant to set, such as "role":"admin" in a profile update?
  • Referer or custom header based checks: access decided by a header the client controls.
  • Multi-step flows: can you jump directly to step 3 of a checkout or approval flow without passing step 2?
  • Files and exports: /files/download?name= and report exports that take an ID.
  • Client-side-only controls: buttons hidden in the UI, but the endpoint works when called directly.

Report minimal proof. Fetching one record belonging to your second test account proves the flaw. Do not iterate through thousands of real customer IDs, which would expose data and could breach the engagement rules.

Fix guidance

  1. Enforce authorisation on the server, for every request, at the object level: "does this user own or have rights to this object?"
  2. Deny by default; centralise checks in a policy layer (for example Laravel Policies, middleware, or framework guards) so no endpoint is forgotten.
  3. Derive the user from the session, not from a request field. GET /me/orders is safer than GET /users/{id}/orders.
  4. Do not rely on obscurity: hidden URLs and unguessable IDs are not access control.
  5. Log and alert on repeated denied access.
  6. Write automated tests for the matrix above so regressions are caught.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. What is horizontal privilege escalation?

    Horizontal means across users of the same level, as when customer A reads customer B's order.
  2. 2. Why do scanners often miss IDOR?

    Ownership rules are application-specific and not visible from the protocol alone.
  3. 3. What is the core manual test for IDOR?

    Replay with a different identity or identifier and see whether the server enforces ownership.
  4. 4. Do random UUID identifiers fix IDOR?

    Unguessable IDs are obscurity; leaked or shared IDs still work without a server-side check.
  5. 5. Where should the current user identity come from?

    Anything the client sends can be changed, so identity must come from the authenticated session.

Summary

  • Access-control bugs are authorisation failures: horizontal, vertical, function-level, and IDOR.
  • Build a role matrix, then replay requests with another session, no session, and changed identifiers.
  • Use Autorize-style extensions for scale, but verify results by hand; also try methods, paths, mass assignment and multi-step bypasses.
  • Fix with server-side object-level checks, deny-by-default policies, and identity from the session.
  • Keep proof minimal; the Python model is an offline stand-in.

Next: CSRF and CORS testing