How I Found an Auth Flaw in a Government Site: From GraphQL Intro
A GraphQL endpoint on a government site allowed unauthenticated queries to retrieve sensitive participant data, including names, emails, and phone numbers. An attacker could harvest this personally identifiable information without any credentials.
Published on infosecwriteups.com
GraphQL has become increasingly popular because it allows clients to request exactly the data they need.
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 resolvers did not enforce authentication or authorization checks, allowing anonymous access to sensitive queries.
Impact
An attacker could retrieve personally identifiable information (PII) such as names, email addresses, phone numbers, departments, and designations without authentication, enabling targeted phishing and data harvesting.
What the attacker needed
No authentication required; GraphQL endpoint accessible
The fix
The issue was fixed by the organization approximately one month after responsible disclosure.
How it was found
- Notice a GraphQL version disclosure in the application source.
- Capture a GET request to an API endpoint in Burp Suite.
- Modify the request to a POST with a GraphQL query to confirm GraphQL processing.
- Send an introspection query to check if schema introspection is enabled.
- Use GraphQL Voyager to visualise the schema and identify sensitive queries.
- Remove all authentication headers and send a query for candidate data, receiving a 200 OK with 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.
GraphQL is a way for apps to ask a server for specific data. Here, the server did not check who was asking, so anyone could request private details about people. This is like a library that lets anyone read confidential files without a library card.
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.