Race to Root: How a GraphQL Race Condition Let Me Execute Admin
A GraphQL mutation for creating admin actions was exposed without authentication, and a race condition allowed it to be executed twice, producing two sensitive log exports. The leaked logs contained a JWT signing secret, which the author used to forge an admin token and access admin user data.
Free Link🎈
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 GraphQL mutation lacked authentication and authorization checks, and the export action was not protected against concurrent execution.
Impact
An unauthenticated attacker could trigger sensitive log exports and, using secrets in those logs, forge an admin token to read admin user data.
What the attacker needed
GraphQL endpoint with introspection; No authentication required; Ability to send parallel requests
How it was found
- Find the GraphQL endpoint and enable introspection to list mutations.
- Send a createAdminAction mutation without any authentication token.
- Use Turbo Intruder to send many exportSensitiveLogs requests in parallel.
- Observe two export files with different filenames containing overlapping sensitive data.
- Extract the JWT signing secret from the exported logs.
- Forge an admin JWT with the leaked secret and query listAllAdminUsers.
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 a way for apps to ask a server for data or to perform actions. Here, a powerful action meant for administrators could be run by anyone, and sending many requests at the same moment made it run twice. The extra run produced log files that contained a secret key, which then let the person pretend to be an administrator.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.