Skip to content
Account takeover Write-up Intermediate

How a Simple GraphQL Scope Bypass Led to an Account Takeover ($4,500 Bounty)

A GraphQL profile-update mutation accepted an optional userId parameter without checking whether the caller owned that account, so an authenticated attacker could change a victim's email address. The attacker could then trigger a password reset to the new address and take over the victim's account.

T4nv1 Follow

Published on medium.com

When hunting on large target programs, standard REST endpoints are often heavily audited and hardened by automated scanners. GraphQL endpoints, however, frequently contain hidden implementation flaws due to complex object nesting, fragmented permission layers, or missing scope checks on specific mutations.

T4nv1, 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

The resolver trusted a client-supplied userId override instead of deriving the target user from the authenticated session and checking authorisation.

Impact

An authenticated attacker could take over any user's account, gaining access to sensitive customer data, API keys and administrative configurations within tenant accounts.

What the attacker needed

A free account on the target; knowledge of the victim's user ID; Burp Suite or similar proxy

The fix

The resolver was patched to derive the user from the session and enforce authorisation before applying any userId override.

How it was found

  1. Create two test accounts, one attacker and one victim.
  2. Capture the normal profile-update GraphQL request in Burp Suite.
  3. Send the request to Burp Repeater.
  4. Add the victim's userId and an attacker-controlled email to the input object.
  5. Send the modified request and observe the server updating the victim's email.
  6. Use the password reset flow on the attacker-controlled email to take over the victim 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.

A GraphQL endpoint is an API that lets clients ask for exactly the data they need, including running actions called mutations. Here, the action that updates a profile trusted a user ID sent by the client instead of using the logged-in user's identity, so anyone could edit someone else's profile. Changing the victim's email let the attacker reset the password and take over the account.

What is Account takeover?

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.

More by T4nv1

View all

113 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.