Access control testing
Access control bugs are the best return on recon. No scanner finds them reliably, because only you know which two users should not see each other’s data. Your recon output already lists the endpoints. This part turns that list into a test plan.
This page is the short version. The IDOR Hunting guide goes deep on identifier formats and the multi-account diff. The Broken Access Control guide covers vertical escalation, transport tricks and account takeover.
The two-account method
Section titled “The two-account method”Every access control test needs at least two identities, so you can ask “can account A reach account B’s thing?”.
-
Create two accounts at the same privilege level, A and B, on the target. A plays the attacker and B the victim. Note each one’s object IDs: user id, order ids, document ids, team id.
-
If the app has roles, create a third low-privilege account C (viewer, member) and a high one if you can (admin, owner). Vertical tests ask whether C can do what only an admin should.
-
Keep the sessions apart so cookies never mix. Use two browsers, two Firefox containers, or one browser plus
curlwith each token. -
Proxy both through Burp or Caido. You will replay B’s requests with A’s session and watch the response.
# Keep each account's session in its own file for curl-based testsecho 'Cookie: session=AAA...' > acct-a.hdrecho 'Cookie: session=BBB...' > acct-b.hdrIn a multi-tenant app, write down each account’s org_id too. A check that only compares user ids still returns another tenant’s record when the org id is the real boundary.
Horizontal IDOR
Section titled “Horizontal IDOR”Map every endpoint that takes an object identifier. Your recon already surfaced them: ID-style parameters from urls/with-params.txt, and API routes from js/endpoints.txt.
# Pull endpoints that carry an id-like parameter from the archived URLsgrep -Ei '[?&](id|user_id|account|order|uuid|doc|file|team|invoice)=' urls/with-params.txt | sort -u > params/idor-candidates.txtFor each candidate, log in as A, then replay the request that returns A’s object, swapping A’s id for B’s. Do it in Repeater so you see the full response. A clean confirmation is A’s session returning B’s name, email or document.
A read of B’s invoice proves the check failed for GET. Repeat the same swap on the DELETE or PATCH for that object. Those handlers often check on their own, and a write is the report you want.
GET /api/v1/invoices/1042 HTTP/1.1Host: billing.example.comAuthorization: Bearer token_for_account_aAccept: application/json
HTTP/1.1 200 OKContent-Type: application/json
{"invoice_id":1042,"owner_id":"usr_b109","customer_email":"user_b@example.com","amount_cents":45000,"status":"paid"}Account A’s token asked for invoice 1042 and got owner_id usr_b109 with user_b@example.com. That is B’s invoice. The same 200 does not mean A can DELETE or PUT that invoice. Those routes can check ownership in their own handlers.
Autorize automates the replay across your whole session. It runs every request your high-privilege session makes a second time with a low-privilege token and flags where the two responses match.
| Tool | Noise | What it does | Status |
|---|---|---|---|
| Autorize | Light active | Replays each request with a second session, flags “same response” | Burp BApp, maintained |
| Authz | Light active | Similar idea, replays with modified roles | Burp BApp, older |
| AuthMatrix | Light active | Grid of roles against requests you define | Burp BApp, older |
Vertical privilege escalation
Section titled “Vertical privilege escalation”JavaScript bundles ship routes the UI hides from low-privilege users. In js/endpoints.txt from recon, look for routes with admin, internal, manage, role, delete, approve. The front end hides the button; the back end may not check the role. Call the route directly as account C.
# Admin-shaped routes hiding in the JS endpoint listgrep -Ei '/(admin|internal|manage|moderat|approve|role|permission|impersonate)(/|$)' js/endpoints.txt | sort -uPOST /api/v1/users/permissions HTTP/1.1Host: auth.example.comAuthorization: Bearer token_for_account_cContent-Type: application/json
{"target_user_id":"usr_c551","assigned_role":"admin"}
HTTP/1.1 200 OKContent-Type: application/json
{"status":"success","user_id":"usr_c551","role":"admin"}Account C, usr_c551, posted assigned_role admin and the body came back "role":"admin". That is a state change on this route. It does not mean every other admin route is open. A gateway can still check the role on the next path.
When the IDs are UUIDs
Section titled “When the IDs are UUIDs”A random UUID cannot be guessed, so a UUID endpoint looks safe. It often is not. Look for leaks.
- Another endpoint returns a list that includes other users’ UUIDs: a search, an export, an autocomplete, a shared-with list.
- The UUID appears in a URL you can get another user to visit, or in a notification.
- A nearby endpoint still uses a sequential id, and you can map one to the other.
- The object is created with a predictable UUIDv1 (time-based) rather than random v4.
If you can obtain B’s UUID through any of these, the IDOR is live. Record where the leak came from in your report, because “the ID is unguessable” is the first thing a triager will raise.
Mass assignment, the cousin bug
Section titled “Mass assignment, the cousin bug”When a hidden parameter from recon is named role, is_admin, plan, verified or owner_id, the update endpoint may copy request fields straight onto the object. Add the field to a request that is allowed to change your own profile.
# A profile update that tries to grant itself a role (your own account)curl -s -X PATCH https://example.com/api/users/me -H @acct-c.hdr \ -H 'Content-Type: application/json' -d '{"name":"c","role":"admin"}'Read the object back. If role is now admin, the finding is confirmed. Do not then use the elevated access beyond proving it.
PATCH /api/v1/users/me HTTP/1.1Host: app.example.comAuthorization: Bearer token_for_account_cContent-Type: application/json
{"display_name":"Researcher","is_enterprise_plan":true,"verified":true}
HTTP/1.1 200 OKContent-Type: application/json
{"id":"usr_c551","display_name":"Researcher","is_enterprise_plan":true,"verified":true,"email":"researcher@example.com"}The response stored is_enterprise_plan and verified from fields the client sent. Read the user back on a later request and confirm the columns stayed. A column flip does not by itself turn on paid features. Billing can still check a payment record.
OAuth and OIDC misconfigurations
Section titled “OAuth and OIDC misconfigurations”Sign-in-with flows carry their own access control bugs. Recon surfaces them when httpx and JS analysis show an /oauth, /authorize or /callback endpoint and a redirect_uri parameter.
| Flaw | Test | Why it works |
|---|---|---|
Weak redirect_uri validation |
Change redirect_uri to https://attacker.example.io, or append .attacker.example.io, @attacker.example.io, /../, or an open redirect on the real domain |
The code or token is sent to you |
Missing state |
Remove state and complete a login CSRF |
Attacker links a victim session to the attacker account, or vice versa |
| Implicit flow token leak | Token returned in the URL fragment leaks via Referer or history | Any page that loads an attacker resource can read it |
| Authorization code reuse | Replay a used code at the token endpoint |
A code should be single-use; reuse means account access |
# Smoke-test redirect_uri handling: does the server follow a changed host?curl -s -i "https://example.com/oauth/authorize?client_id=web&response_type=code&redirect_uri=https://attacker.example.io/cb&state=x" | grep -i '^location:'If the Location points at your host carrying a code, you have a redirect_uri bug. Confirm the code actually exchanges for a token before you call it critical. Keep an open redirect on the target domain in mind: it chains into this when exact-match validation is missing.
JWT attacks
Section titled “JWT attacks”When the session is a JSON Web Token, the token itself is the access control. Decode it first (the middle segment is base64 JSON), then test whether the server really verifies the signature.
| Attack | Test | Why it works |
|---|---|---|
alg:none |
Set the header alg to none and strip the signature |
A server that honours none skips verification entirely |
| Weak secret | Crack an HS256 token against a wordlist, then re-sign with new claims | A guessable secret lets you mint valid tokens |
kid injection |
Point the kid header at a file you control or inject SQL into it |
The server loads the signing key from an attacker-influenced path |
| Algorithm confusion | Re-sign an RS256 token as HS256 using the public key as the secret | The server verifies with the wrong key type |
jwt_tool runs all of these from one command and flags which the server accepts.
# Run the common checks, including alg:none and a secret-cracking passjwt_tool "$TOKEN" -M at -t https://example.com/api/me -rh "Authorization: Bearer $TOKEN"# Crack an HS256 secret offline, then forge a new tokenjwt_tool "$TOKEN" -C -d /usr/share/wordlists/rockyou.txtJWT also shows up as an API authentication scheme in API and service testing. The token mechanics are the same, so test it once and cross-reference rather than duplicating the work.
SAML single sign-on carries access control in a signed XML assertion. The classic bugs are signature handling. The service provider may accept an unsigned assertion, verify the wrong element, or fall to XML signature wrapping. In wrapping, a second, attacker-controlled assertion rides alongside the signed one. Capture a SAMLResponse, decode it (base64 then inflate), and test whether editing the NameID or wrapping the assertion is caught. The SAML Raider extension for Burp automates the edits and the wrapping payloads. XXE in the assertion parser is also in play; the OOB entity probe is in injection. Stop at the first accepted edit; the Broken Access Control guide covers the full account takeover chains.
Password reset, 2FA and session flaws
Section titled “Password reset, 2FA and session flaws”These authentication bugs sit next to access control because they all end in using another account.
- Password reset. Watch the reset request and response. These are reportable: a token in the response body, or one that never expires or is reused. A reset that does not invalidate old sessions is reportable too. So is a
Hostheader the reset link honours, because host header injection poisons the link. Test whether changing the account identifier in the reset-confirm step resets someone else’s password. - 2FA bypass. After the password step, try these: request the post-2FA endpoint directly and remove the 2FA parameter. Send an empty or
truecode, or reuse a code. Brute force a short code with no rate limit. A flow that lets you reach the authenticated area without a valid code is the bug. - Session fixation. Note the session cookie before login. If the same cookie value is still valid after you authenticate, an attacker who planted it now shares the session. A login should issue a fresh session identifier.
For the full chains, see the Broken Access Control guide on OAuth, 2FA and MFA, password reset, sessions and session tokens and JWT. Here, stop at the first signal that proves the flaw.
Race conditions
Section titled “Race conditions”When a limit is checked and then applied in two steps, firing the request many times at once can slip between the two. Burp’s Turbo Intruder sends a single-packet batch so dozens of requests arrive together, which beats the check-then-act window far better than a sequential loop.
# Turbo Intruder: single-packet attack, 30 copies of the same requestdef queueRequests(target, wordlists): engine = RequestEngine(endpoint=target.endpoint, concurrentConnections=1, engine=Engine.BURP2) for i in range(30): engine.queue(target.req, gate='race1') engine.openGate('race1')Good targets are redeeming a one-time code twice and applying a coupon more than once. Others are withdrawing a balance in parallel and accepting an invite repeatedly to gain extra seats. Prove it with your own accounts and the smallest effect that shows the limit broke.
The endpoint matrix
Section titled “The endpoint matrix”The reason access control bugs get missed is that there are too many endpoints to hold in your head. Put them in a grid so nothing is skipped.
Make a spreadsheet. One row per endpoint and method. Columns: URL, method, object id param, “A reaches B?”, “C does admin?”, “unauth reaches it?”, result, notes. Fill it as you test. An empty cell is an untested path, not a safe one.
# Seed the matrix: method and path pairs from your crawl, deduplicatedjq -r '.url' http/httpx.json >/dev/null 2>&1; cat js/endpoints.txt urls/api.txt 2>/dev/null | sort -u > access/endpoints-to-test.txtWork the matrix against your now queue from triage. Access control is slow, manual and the highest-paying class in this guide. The spreadsheet is what makes it thorough.
Next, send payloads at the parameters your recon filtered in injection.
Companion deep-dive guides
Section titled “Companion deep-dive guides”- Object-level authorization: IDOR fundamentals and IDOR bypasses.
- Role, tenant, and auth flows: Broken Access Control foundations and ATO manuals.
- Real-time frames: WebSocket CSWSH.
Open local graph around this page
Linked from here
Links out to
- IDOR Hunting Zero to Advanced↗ IDOR Hunting
- Broken Access Control: The Complete Bug Bounty Guide↗ Broken Access Control
- Broken Authentication & Account Takeover↗ Broken Access Control
- OAuth & Social Login↗ Broken Access Control
- 2FA/MFA↗ Broken Access Control
- The Password Reset Flow↗ Broken Access Control
- The Session Layer↗ Broken Access Control
- The Session & Token Foundry↗ Broken Access Control
- What IDOR Actually Is↗ IDOR Hunting
- Bypass Techniques↗ IDOR Hunting
- Foundations↗ Broken Access Control
- Cross-site WebSocket hijacking↗ WebSocket
Recon AtlasFor authorized testing only. Your scope is the map edge.