Skip to content
Access control Write-up Intermediate

Getting all info about my coworkers via unprotected GraphQL path

A GraphQL endpoint exposed two different queries that both returned the same user object, but only one of them enforced the intended access rules. An employee-level user could therefore retrieve other employees' contact details, payroll figures and inactive accounts that the role was not meant to see.

medium.com

Published on medium.com

Hi there, Mohammed Ahmed is here, today I gonna share with you some interesting finding that shows why graphql is so hard to implement access controls on it, can show us interesting behavior, and how I test graphQL for interesting BAC issues.

CANITEY, 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 the same data object was reachable through two separate GraphQL queries, and the authorisation check was only applied to one of them.

Impact

An employee-level account could read other employees' emails, addresses, phone numbers, birth dates, payroll figures and inactive accounts, which the role matrix said it should not see.

What the attacker needed

A low-privilege employee account; knowledge of the company identifier

How it was found

  1. Identify which GraphQL implementation the target uses, sending session cookies because the endpoint sits behind authentication.
  2. Recover the schema despite introspection being disabled, by abusing the autocompletion and auto-correction behaviour with a schema enumeration tool.
  3. Visualise the recovered schema to spot objects with more than one incoming query path.
  4. Compare those paths against the site's role matrix to find one that skips the intended checks.
  5. Send a query through the unprotected path for the target company and read back the user records.

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 API is a way for a website to ask a server for exactly the data it needs, using named queries. The site meant to hide some staff details from ordinary employees, but it had a second query that reached the same data without checking who was asking, so anyone logged in as an employee could read it.

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.