GraphQL
Found a target using GraphQL?
Run the introspection query to map out all methods
Use GraphQL Voyager to display all methods
Use BatchQL or the InQL extension to test all methods for IDORs, SQLi, SSRF, etc
Definition
Query is an operation to retrieve data (read).
Mutation is an operation used to submit and write data (create, update, and delete).
Subscription is an operation used to send data (read) when an event occurs. Subscription is a way for GraphQL clients to listen to live updates from the server.
Detection
Basics
Fingerprinting
Scan
Introspection enabled

Introspection disabled
Error Messages

JS Files
Download all js files to directory js_files
Run this command:

Scan endpoints
Wordlists
IDOR
IDORChange the internalId field
Add extra field
Initial query
Modified query
Path Traversal
File Inclusion LFI / RFIMass Asignement - mutation
Mass AssignmentInitial query
Modified query - role added
CSRF
Bypassing rate limits

Batching attack
Tool: batchql
SQL injection
Get all informations about the API schema:
Ex:
SQL injection - Time based

Automated - Graphqlmap
NoSQL Injection
NoSQL injectionUse $regex, $ne frominside a search parameter.
LDAP Injection
LDAP InjectionCommand injection
Command InjectionXSS
XSSHTML Injection
DoS throught batched queries
Wordlists
GraphQL Raider - Burp Extension
InQL
Burp Extension
CLI
Tools
Interesting Book
Black Hat GraphQL: Attacking Next Generation APIs This hands-on book teaches penetration testers how to identify vulnerabilities in apps that use GraphQL, a data query and manipulation language for APIs adopted by major companies like Facebook and GitHub.
Support this Gitbook
I hope it helps you as much as it has helped me. If you can support me in any way, I would deeply appreciate it.
Interesting Reports
1. https://hackerone.com/reports/2048725
2. https://hackerone.com/reports/2524939
3. https://hackerone.com/reports/2357012
4. https://hackerone.com/reports/2122671
5. https://hackerone.com/reports/2207248
6. https://hackerone.com/reports/1864188
7. https://hackerone.com/reports/1085332
8. https://hackerone.com/reports/1084904
9. https://hackerone.com/reports/1293377
10. https://hackerone.com/reports/1192460
Resources
Last updated


