Blog / A01:2021 Broken Access Control
A01:2021 · Broken Access Control

Your path names the victim, and nothing checks it's you

The endpoint issues a token for the user and partner named in the URL. It confirms your role and never confirms those values belong to you.

Caller requests atoken via a…Path carries auser…Controller checksthe caller's roleNo check tiesthose values…A token is issuedfor…ATTACKER INPUTIMPACTcheck absent
Attack path · Caller requests a token via a URL path → Path carries a user identifier and a partner code → Controller checks the caller's role → No check ties those values to the caller → A token is issued for someone else's identity

The endpoint issues a token for the user and partner named in the URL. It confirms your role and never confirms those values belong to you.

What goes wrong

A token-issuing endpoint reads two values out of the URL path: whose token to make and which partner it is for. Both are attacker-controlled, because both are just path segments the caller types. The controller checks that the caller holds a role and then generates the token.

What is missing is the check that binds those path values to the authenticated caller. There is no confirmation that the user identifier is the caller's own, and no confirmation that the caller is allowed to act for that partner. So a valid, low-privilege user can walk other users' identifiers and other partners' codes and mint tokens across the boundary.

This is textbook IDOR. The identifier of the thing you are acting on comes from the request, and authorization stops at 'are you logged in with the right role' instead of 'is this yours'.

The pattern

Vulnerable
@RequireRole('partner')
def generateToken(userId, partnerCode):   # both from the URL
    token = tokens.issue(userId, partnerCode)
    return { 'token': token }
# nothing checks userId or partnerCode against the caller
Hardened
@RequireRole('partner')
def generateToken(userId, partnerCode):
    if userId != caller.userId:
        deny()                       # act only on yourself
    if partnerCode not in caller.allowedPartners:
        deny()                       # or an entitlement check
    return { 'token': tokens.issue(userId, partnerCode) }
How the pipeline adjudicated itHELD
ABCDEFGH

Grounding and reachability were confirmed. The exploit-path gate would not conclude without the calling code, so the finding was held and an evidence request was raised instead of being reported as fact.

Ed25519 · per-tenant signing key · gate ledger A–H · verify offline against the published payload hash

Why it matters to you

Cross-identity token generation is a foothold, not a dead end. A token for another user is impersonation. A token for another partner crosses a tenant line you probably sell as a hard boundary. The fact that the caller needed a valid account first does not save you, because valid accounts are exactly what attackers acquire.

Every identifier in a path or query is caller input. If acting on it affects data that is not the caller's, you owe an object-level check, and it has to compare the requested identifier against the authenticated principal rather than against a role.

Check your own code