Approaching GraphQL End Points
Brief note on how you can proceed for testing GraphQL end points
In short GraphQL is one of the most modern ways of building and querying APIs.
Identification
Start fuzzing your target by including below end points in your word-list.
Once you identified the GraphQL end point then proceed for below checks.
Common Miss Configurations in GraphQL
Introspection enabled
Introspection query retrieves the complete documentation and list of all API calls that are available in back-end.
To check whether introspection is enabled or not you can make POST
request to identified GraphQL end-point with the following query
If the introspection is enabled then you will get complete list of all API calls in response.
The response will be big and difficult to understand the schema, follow below steps for the better visualization of schema.
Navigate to graphql-voyager
Click on Change Schema
Then navigate to Introspection tab
Copy entire introspection query response you got from the above query and paste here and click Display
Now go through the the chart thoroughly for better understanding on work flow and get ready to play with the queries
Vulnerabilities to Check
Mainly you can look for below vulnerabilities in GraphQL end points but not limited to
SQL and NoSQL
IDOR
Brute Force Attack
CSRF
Information Disclosure
Tools
Most of the GraphQL chart have loops and N number of paths and it will be difficult to track each path manually, so below listed tools can be used to reduce manual work while analyzing end points.
GraphQLmap provides an interactive shell to play with GraphQL end points
graphql-path-enum can be used retrieve different ways of reaching a given type in a GraphQL schema.
You can also use graphql-introspection-analyzer.py for analyzing end-points
Burp Suite Extension
You can include InQL extension in Burp to play with GraphQL end-points
References
>https://blog.doyensec.com/2018/05/17/graphql-security-overview.html
>https://blog.doyensec.com/2020/03/26/graphql-scanner.html
>https://medium.com/bugbountywriteup/graphql-voyager-as-a-tool-for-security-testing-86d3c634bcd9
>https://medium.com/@the.bilal.rizwan/graphql-common-vulnerabilities-how-to-exploit-them-464f9fdce696
Thanks for reading:)
Follow me on twitter @0xAyub for more notes
Last updated