Skip to content
Access control Write-up Intermediate

Mass Account Takeover of 29,000 Accounts by Abusing GraphQL

A production GraphQL endpoint had introspection enabled, revealing undocumented queries that exposed password reset tokens and PII for over 29,000 users. An attacker could retrieve a victim's reset token and complete a password reset to take over the account.

medium.com

Published on medium.com

While testing a GraphQL endpoint, I noticed that introspection was enabledin production. Running an introspection query exposed the entire GraphQL schema, including undocumented queries and mutations.

Bryan Matthew, on medium.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 broken access control on sensitive GraphQL resolvers, combined with introspection enabled in production, exposed password reset tokens and user data without authorisation checks.

Impact

The vulnerability allowed full account takeover, administrator compromise, and exposure of over 29,000 users' PII, and an attacker could fully automate the attack against every user on the platform.

What the attacker needed

GraphQL endpoint with introspection enabled; No authorization on sensitive queries; Victim has an account with password reset

The fix

Sensitive GraphQL resolvers should enforce proper access control and password reset tokens should never be exposed through the API.

How it was found

  1. Run an introspection query to list the GraphQL schema and find undocumented queries.
  2. Use the exposed query to obtain valid user emails, including admin accounts.
  3. Trigger a normal password reset request for the target account.
  4. Query tokenForgotPasswords to retrieve the victim's reset token.
  5. Use the token to complete the password reset and gain access to the account.

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.

GraphQL is a way for apps to ask a server for exactly the data they need. This server let anyone list all its hidden queries, including one that returned password reset codes. With a victim's email and reset code, an attacker can set a new password and take over the account.

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.

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.