Blind Extraction of Password Hashes via an Unauthenticated GraphQ
An unauthenticated GraphQL endpoint allowed filtering on sensitive fields such as password hashes and OAuth tokens using a LIKE operator, and returned a count that acted as a boolean oracle. An attacker could recover bcrypt hashes and live OAuth tokens character by character through repeated queries.
During a routine bug bounty assessment of a web platform’s GraphQL API, I noticed something that at first looked mundane: an unauthenticated endpoint that returned a count value in response to user queries. No authentication header.
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 resolver allowed unauthenticated queries with a LIKE filter operator on credential fields and returned a count that revealed whether the pattern matched.
Impact
An attacker could recover bcrypt password hashes for offline cracking and extract live OAuth tokens that are directly usable, potentially leading to account takeover, especially for high-privilege accounts; the text notes no rate limiting was present.
What the attacker needed
No authentication required; GraphQL endpoint accessible; no rate limiting
The fix
The endpoint should require authentication, restrict filter operators on sensitive fields, implement field-level authorization in the resolver layer, and add rate limiting.
How it was found
- Send an unauthenticated GraphQL query filtering by user ID with the EQUAL operator to confirm the endpoint responds and the user exists.
- Add a LIKE condition on the password hash field with a pattern matching the known bcrypt prefix to confirm the oracle returns a count of 1.
- Refine the LIKE pattern character by character, using the count response to determine each correct character.
- Repeat the character-by-character extraction until the full hash is recovered.
- Apply the same count-based oracle technique to OAuth token values by filtering on client ID and active status.
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 programs to ask a server for specific data. Here, the server let anyone ask 'how many users have a password hash starting with these characters?' without logging in. By asking many such questions and watching whether the answer was 1 or 0, an attacker could guess the secret one character at a time, like a game of hangman.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.