You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[JSON List Based Batching](#json-list-based-batching)
@@ -46,8 +47,12 @@
46
47
47
48
### Common GraphQL Endpoints
48
49
49
-
Most of the time GraphQL is located at the `/graphql` or `/graphiql` endpoint.
50
-
A more complete list is available at [danielmiessler/SecLists/graphql.txt](https://github.com/danielmiessler/SecLists/blob/fe2aa9e7b04b98d94432320d09b5987f39a17de8/Discovery/Web-Content/graphql.txt).
50
+
GraphQL endpoints are often exposed at predictable paths, most commonly:
51
+
52
+
-`/graphql`
53
+
-`/graphiql` (interactive IDE)
54
+
55
+
You should always probe for both API and developer/debug interfaces.
51
56
52
57
```ps1
53
58
/v1/explorer
@@ -60,12 +65,32 @@ A more complete list is available at [danielmiessler/SecLists/graphql.txt](https
60
65
/graphiql.php
61
66
```
62
67
68
+
For an extended wordlist, see [danielmiessler/SecLists/graphql.txt](https://github.com/danielmiessler/SecLists/blob/fe2aa9e7b04b98d94432320d09b5987f39a17de8/Discovery/Web-Content/graphql.txt).
> A server MUST accept POST requests, and MAY accept other HTTP methods, such as GET. - [GraphQL Over HTTP](https://graphql.github.io/graphql-over-http/draft/#sec-Request)
The GraphQL specification includes special fields, such as `__schema` and `__type`, that allow clients to ask the server what types exist, what fields they expose, and how everything connects together.
106
+
107
+
An introspection query is simply a request that leverages these special fields to retrieve that structural information. This is what allows interactive environments like GraphiQL or GraphQL Playground to provide auto-completion, inline documentation, and query validation. When a developer types a query, the tool is not guessing, it has already asked the server what is valid and what is not.
{__schema{queryType{name}mutationType{name}subscriptionType{name}types{...FullType}directives{name description locations args{...InputValue}}}}fragment FullType on __Type{kind name description fields(includeDeprecated:true){name description args{...InputValue}type{...TypeRef}isDeprecated deprecationReason}inputFields{...InputValue}interfaces{...TypeRef}enumValues(includeDeprecated:true){name description isDeprecated deprecationReason}possibleTypes{...TypeRef}}fragment InputValue on __InputValue{name description type{...TypeRef}defaultValue}fragment TypeRef on __Type{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name}}}}}}}}
193
230
```
194
231
@@ -212,11 +249,16 @@ Enumerate the definition of interesting types using the following GraphQL query,
When working with a GraphQL schema, especially after running an introspection query, it is not always obvious how a specific type can be accessed through queries. A given object (like `User`, `Admin`, or `Payment`) may be reachable through multiple entry points and nested relationships.
255
+
256
+
- [dee-see/graphql-path-enum](https://gitlab.com/dee-see/graphql-path-enum) - Tool that lists the different ways of reaching a given type in a GraphQL schema.
257
+
258
+
This tool takes the JSON output of an introspection query (which describes the full schema) and analyzes how types are connected. It then outputs different query paths that can be used to reach a specific target type. In practice, this means identifying all the possible ways a client could craft queries that eventually return that object, even if it is deeply nested or indirectly exposed.
@@ -237,47 +279,94 @@ Found 27 ways to reach the "Skill" node from the "Query" node:
237
279
238
280
## Methodology
239
281
240
-
### Extract Data
282
+
GraphQL supports three main operation types: **queries**, **mutations**, and **subscriptions**.
283
+
284
+
### Queries
285
+
286
+
GraphQL queries are used to request specific fields from a schema, and the structure of your query directly mirrors the JSON response you will receive. At its simplest, querying data means selecting a root field (like `user`, `posts`, or `teams`) and then specifying which subfields you want returned. Unlike REST, you never get extra data, everything must be explicitly requested.
287
+
288
+
#### Basic Query
289
+
290
+
The simplest query uses the shorthand syntax, where the `query` keyword is omitted. You just define the fields you want starting from the root object.
291
+
292
+
```js
293
+
{
294
+
user {
295
+
id
296
+
name
297
+
}
298
+
}
299
+
```
300
+
301
+
This tells the server to return the `id` and `name` fields from the user object. The response will follow the exact same structure. If needed, the full syntax can be used with the query keyword, but in most cases the shorthand is enough and commonly seen in real-world traffic.

247
313
248
-
### Extract Data Using Edges/Nodes
314
+
#### Query with Arguments
249
315
250
-
```json
316
+
To retrieve specific data, arguments can be passed to fields. These behave like function parameters and are often used for IDs, filters, or search queries.
317
+
318
+
```js
251
319
{
252
-
"query":"query {
253
-
teams{
254
-
total_count,edges{
255
-
node{
256
-
id,_id,about,handle,state
257
-
}
258
-
}
259
-
}
260
-
}"
261
-
}
320
+
user(id:"1") {
321
+
name
322
+
email
323
+
}
324
+
}
262
325
```
263
326
264
-
### Extract Data Using Projections
327
+
This allows precise targeting of objects and is a common entry point for testing access control issues or IDOR-style vulnerabilities.
265
328
266
-
:warning: Don’t forget to escape the " inside the **options**.
329
+
#### Nested Queries
330
+
331
+
GraphQL allows deep traversal of relationships in a single request. Instead of chaining multiple API calls, you can explore linked objects directly.
267
332
268
333
```js
269
-
{doctors(options:"{\"patients.ssn\" :1}"){firstName lastName id patients{ssn}}}
334
+
{
335
+
user(id:"1") {
336
+
name
337
+
posts {
338
+
title
339
+
comments {
340
+
content
341
+
}
342
+
}
343
+
}
344
+
}
270
345
```
271
346
272
347
### Mutations
273
348
274
-
Mutations work like function, you can use them to interact with the GraphQL.
349
+
A mutation is an operation used to change data on the server (create, update, or delete something).
350
+
Mutations work like function, you can use them to interact with the GraphQL endpoint.
0 commit comments