The lab
here is how portswigger describes it
The user management functions for this lab are powered by a GraphQL endpoint. The lab contains an access control vulnerability whereby you can induce the API to reveal user credential fields. To solve the lab, sign in as the administrator and delete the username carlos.
the new pieces in this lab#
building on the introspection lab, this one shows how introspection reveals a query that exposes credential fields, and how a direct object reference (an id) lets us pull any user's record.
- a mutation is a GraphQL operation that changes data (the counterpart to a read-only query). login here is a mutation carrying a username and password. it's still sent to the same single GraphQL endpoint.
- saving queries to the site map: Burp can take the introspection result and reconstruct every available query/mutation as a ready-to-send request, filing them under Target > Site map. that turns the raw schema into a browsable list of operations we can fire, no hand-writing the GraphQL.
- an overexposed query + direct object reference: among the saved operations is a
getUserquery that returns a user'susernameandpassword, and it selects the user by a plainidnumber. passing anidwe choose is a classic IDOR (insecure direct object reference), there's no check that theidbelongs to us, so we can request any user's record, including the admin's. the method: run introspection, save the operations to the site map, spot thegetUserquery that returns credentials byid, then iterate theiduntil it returns the administrator's username and password, and use them to log in and delete carlos.
why the exposed field and id leak the admin's credentials#
two failures combine. first, a password field is selectable on the user type through the getUser query, credentials should never be returnable by an API at all, but here the schema exposes them, so any caller who names the field gets it. second, getUser fetches a user purely by an id argument with no authorization check tying that id to the caller, so we can substitute any id and read that user's record. introspection (saved to the site map) hands us the exact query and its shape, removing all guesswork about field and argument names. with both problems present, asking getUser(id: 1) for username and password simply returns the administrator's credentials; the API was never designed to withhold them. obscurity and the absence of per-object access control are the whole vulnerability.
Step 1 - capture the login mutation#
we access the lab, select My account, and attempt to log in. in Proxy > HTTP history we see the login is sent as a GraphQL mutation containing a username and password. we right-click the login request and Send to Repeater.

Step 2 - introspect and save the operations#
in Repeater we right-click the Request panel and choose GraphQL > Set introspection query to insert an introspection query, then send it. we right-click the message and choose GraphQL > Save GraphQL queries to site map. in Target > Site map we review the operations and notice a getUser query that returns a user's username and password, fetching the user by a direct id reference.

Step 3 - IDOR the user id to the admin#
we right-click the getUser query and Send to Repeater, then click Send. the default id of 0 returns no user. in the GraphQL tab we test alternative id values until the API returns the administrator's credentials, here the administrator's id is 1.

Step 4 - log in and delete carlos#
we log in to the site as the administrator with the recovered credentials, go to the admin panel, and delete carlos.

with this, the lab is solved!
