Skip to content
Access control Write-up Intermediate

Exposing Users Table From a Leaky GraphQL Query

The GraphQL API exposed an 'auth_user' query without proper authorization checks, allowing an attacker to retrieve all user data from the users table. The attacker used introspection to discover the query and crafted a request to exploit the missing access control.

Inderjeet Singh Follow

Published on rashahacks.com

I am Inderjeet Singh aka encodedguy on HackerOne. In this blog post, I will give a walkthrough of my recent finding in which I got the data from the users table.

Inderjeet Singh - encodedguy (@3nc0d3dGuY), on rashahacks.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the 'auth_user' GraphQL query lacked proper authorization checks, allowing any user to access the users table.

Impact

An attacker could retrieve all user data from the users table, but only in the beta/staging environment which contained no production data.

What the attacker needed

Access to the beta environment; GraphQL introspection enabled

How it was found

  1. Run an introspection query on the GraphQL API to list all available queries and their arguments.
  2. Identify the 'auth_user' query and its 'distinct_on' argument from the introspection results.
  3. Craft a GraphQL query using the 'auth_user' query and the 'distinct_on' argument.
  4. Receive an error message listing possible values for the argument.
  5. Modify the query with a valid argument value and resend it.
  6. Retrieve all user data from the users table in the response.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

This report is about a GraphQL API that let anyone fetch the entire list of users because it did not check if the person asking was allowed to see that data. GraphQL is a way for apps to ask a server for specific data; introspection is a feature that lists all available queries, which helped the attacker find the weak one.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by Inderjeet Singh

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.