githubEdit

GraphQL Pentesting

Endpoints

/graphql
/api/graphql
/graphql/v1
/v1/graphql
/gql

Wordlist

/usr/share/wordlists/seclists/Discover/Web-Content/graphql.txt

Where to look for GraphQL usage:

1) Login pages

Input data, then press F12 (developer tools) and go in "Network tab". Send the data and check the request/response fields to look for terms like "Query" or "Mutation".

2) Trigger error messages

Example

curl -X POST http://domain.local:8080/graphql

3) JavaScript files

View them by pressing F12 -> Sources/Debugger, then search for keywords like

After verification of GraphQL presence

1) Check for excessive data exposure

Example query

2) Injection

Example query

GraphQL introspection

Tools:

  1. Graphiql https://github.com/graphql/graphiql

  2. Graphql Voyager https://apis.guru/graphql-voyager/

1) Check if schema introspection is enabled

2) Dump the entire GraphQL schema

Example query

Go to GraphQL Voyager and paste the response from the query to visualize the schema.

3) Check what operations you can do with GraphQL

4) SQL Injection example

Example query

Last updated