GraphQL isn't new—it's been around since Facebook open-sourced it in 2015. But here's the thing: Web2 companies are adopting GraphQL at an accelerating pace .
Why? Because modern web applications need flexibility. REST forces you into multiple endpoints; GraphQL gives you one endpoint where clients ask for exactly what they need. This is great for developers but creates unique security blind spots that bug bounty hunters can exploit .
GraphQL vs REST: What Changes for Hackers {#graphql-vs-rest}
Feature | REST | GraphQL |
|---|---|---|
Endpoints | Multiple ( | Single ( |
Data Fetching | Fixed structure per endpoint | Client defines exactly what they need |
Over-fetching/Under-fetching | Common | Rare (by design) |
Introspection | Usually disabled | Often enabled by default |
Attack Surface | Distributed across endpoints | Concentrated in query language |
Rate Limiting | Per-endpoint possible | Harder to enforce |
What This Means for Hunters:
You only need to find one endpoint to test everything
The API tells you what data exists (if introspection is on)
You can combine multiple operations in one request
Rate limiting is trickier for defenders to implement
Common GraphQL Endpoint Paths
/graphql
/api/graphql
/graphql/console
/graphiql
/v1/graphql
/v2/graphql
/gql
/query
/explorer
/graphql.php
/graphiql.phpHow to Find Hidden Endpoints
Method 1: JavaScript File Analysis
Search JS files for keywords:
"query""mutation""graphql""__typename"(GraphQL's built-in field)
This can reveal unofficial or decommissioned GraphQL endpoints
Method 2: Network Tab in DevTools
Open browser DevTools → Network tab
Interact with the app
Look for POST requests with
application/jsoncontent-typeCheck request bodies for
{"query":patterns
Method 3: Response Fingerprinting
Send this simple query:
{"query": "{ __typename }"}A successful response with HTTP 200 and a "data" field confirms GraphQL is live
Method 4: Wayback Machine & GitHub
Search historical data for GraphQL endpoints
GitHub dorking:
"graphql" + "target.com"
GraphQL Query Vulnerabilities
Attack #1: Excessive Data Exposure
The client asks for exactly what they want. If the resolver fetches more data than needed and filters it in code, attackers can request those extra fields
Example:
query {
users {
id
email
passwordHash # Shouldn't be accessible
internalNotes
}
}If the resolver fetches all user fields and only filters at the GraphQL layer, adding passwordHash to your query might return it
Attack #2: IDOR (Insecure Direct Object Reference)
Consider this legitimate query
query {
currentUser(internalId: 1337) {
role
name
email
token
}
}Test: Change the internalId to 1338, 1339, etc. If you get another user's data, that's an IDOR—a critical finding
Attack #3: Field Injection
Start with a normal query
query {
listPosts(postId: 13) {
title
description
}
}Now add fields that might exist:
query {
listPosts(postId: 13) {
title
description
}
user {
username
email
firstName
lastName
}
}If the server processes this, you've just accessed user data through a posts query—likely an authorization bypass
Attack #4: Injection Vulnerabilities
GraphQL doesn't prevent SQL/NoSQL injection—it's just a layer on top
SQL Injection:
graphql
query {
user(id: "1' OR '1'='1") {
email
password
}
}NoSQL Injection:
graphql
query {
user(id: "{\"$ne\": null}") {
email
}
}Test with:
Special characters:
',",`,;,$,{
SQL payloads:
1 OR 1=1XSS payloads:
<script>alert(1)</script>
Tools for GraphQL Hacking
Tool | Purpose | Link |
|---|---|---|
InQL (Burp) | Introspection + query generation | Burp BApp Store |
GraphQL Raider (Burp) | Visual query builder, fuzzing | Burp BApp Store |
GraphQL Voyager | Schema visualization | |
Clairvoyance | Introspection bypass via field suggestions | GitHub |
GraphQLmap | Interactive fuzzing | GitHub |
graphw00f | GraphQL fingerprinting | GitHub |
graphql-path-enum | Path enumeration | GitHub |









Comments (0)