GraphQL introspection query works through unauthenticated WebSocket
An unauthenticated WebSocket connection allowed execution of GraphQL introspection queries, exposing the full API schema. An attacker could use this information to plan more complex attacks.
Originally disclosed on HackerOne
- Disclosed after 8 months
Summary:
It is possible to execute GraphQL introspection query through unauthenticated WebSocket connection. PoC included.
Steps To Reproduce:
To simplify reproducing I provided a simple html PoC file.
- Start python static http server in directory with poc file:
python3 -m http.server(this step is required to bypass CORS restrictions for opening local file in the browser) - Open file in the browser: http://localhost:8000/ws.html
- GraphQL schema dump will be displayed on the page
The problem occurs because of the websocket request with type start(maybe others too, I didn't check) allows to pass introspection query in it ({type: "start", payload: {query: "query IntrospectionQuery{ ... }"}})
Supporting Material/References:
Impact
This information reveals the full GraphQL API with all methods and data types. This can be used to perform more complex attacks.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the WebSocket endpoint did not enforce authentication before processing GraphQL 'start' messages, allowing introspection queries.
Impact
This reveals the full GraphQL API with all methods and data types, which could be used to perform more complex attacks.
What the attacker needed
No authentication required; WebSocket endpoint accessible
How it was found
- Start a local HTTP server to serve the PoC file and avoid CORS issues.
- Open the PoC HTML file in a browser.
- Observe the GraphQL schema dump displayed on the page.
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 report has not been written yet. The Original tab links to the source.
GraphQL is a way for apps to ask a server for data. Normally, only logged-in users should be able to ask the server to describe its entire data structure (called introspection). Here, anyone could do that without logging in, which gives attackers a map of the API.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.