GraphQL Introspection
The spec-defined
__schema/__typemeta-fields that let a client pull the full type system; for an attacker it is the map of every query, mutation and argument, and disabling it hides the map without closing any door.
How it works
Introspection is queried with GraphQL itself. Every endpoint also exposes the reserved __typename field, which makes the cheapest liveness/identity probe:
query{__typename} # any GraphQL endpoint -> {"data":{"__typename":"Query"}}
{__schema{queryType{name}}} # is introspection on?The full IntrospectionQuery (Burp and graphql-core’s get_introspection_query() generate it) returns queries, mutations, subscriptions, types, args, enum values and descriptions. If it fails on an endpoint that answers the probe, strip the legacy onOperation / onFragment / onField directive fields, which many servers reject. In one lab the 1,479-byte standard query returned 26,454 bytes covering 17 types.
Defaults matter: Apollo Server enables introspection unless NODE_ENV=production; graphql-core leaves “Did you mean” suggestions on by default.
Schema recovery when introspection is “off”
| Technique | What it exploits |
|---|---|
| Regex-filter bypass | Filters that match __schema{ miss __schema followed by newline, space or comma, which the GraphQL lexer ignores |
| Alternate transport | Introspection blocked only on JSON POST; retry as GET /graphql?query=query%7B__schema%0A%7BqueryType%7Bname%7D%7D%7D or form-urlencoded POST |
| Field suggestions | Cannot query field 'setRol' on type 'Mutation'. Did you mean 'setRole'? — also leaks argument names (Did you mean 'username'?) and type names. Clairvoyance / clairvoyancex automate full schema rebuild from these hints |
| Recursive suggestion harvest | Seed near-miss names (usr, acount, admn, paymnt), add every suggested name back to the wordlist and recurse into its type; wrong-shaped arguments (user(i: 1) → Did you mean "id"?) leak argument names. clairvoyance -o schema.json -w wordlist.txt <url> emits an introspection-shaped schema |
| Error-shape oracle | With suggestions hidden, a real field still errors differently (Field 'setRole' of type 'User' must have a selection of subfields) from a fake one (Cannot query field 'grantAdmin') — wordlists still confirm names |
| Client artifacts | Operations seen in proxy history and persisted/bundled queries in front-end JS give real field and argument names |
| Engine fingerprint | graphw00f (and InQL’s fingerprinter) identify the engine even with introspection off, pointing at engine-specific defaults and CVEs |
Once you have schema.json, mine it rather than just reading it: GraphQL Voyager for relationships, graphql-path-enum to list every path to a type, and the OWASP one-liner to spot Relay node entry points:
jq '.data.__schema.types[] | select(.name=="Query") | .fields[] | .name' schema.json | grep nodeWhy “disable introspection” is not a fix
A scripted graphql-core 3.2.14 fixture tested four configs for an undocumented adminUserRecord(id) field: with introspection disabled but no resolver check, an ordinary user calling the field by name still got another user’s email and ID digits; the “Did you mean” hint naming the field appeared in all four configs. Only the resolver authorization check stopped the leak. A separate lab reached the same conclusion with a deliberately unguarded setRole mutation: identical result on default, no-introspection and hardened profiles. Treat introspection findings as a precondition that accelerates GraphQL Authorization Flaws, not as impact.
Notable cases
- Parse Server CVE-2025-53364 — GraphQL schema served publicly without session token or master key; fix requires the master key, with a temporary
graphQLPublicIntrospectionopt-out. - Mass ATO of 29,000 accounts — production introspection revealed an undocumented
tokenForgotPasswordsquery returning live reset tokens plus a PII query exposing users and admins; enumerate → trigger reset → read token → reset. - Overgrowth (HI CyberCon CTF 2026) — introspection off, but validation errors named
resetPasswordand its args; the 4-digit code then fell to GraphQL Batching Attacks. - GitLab CVE-2021-4191 — unauthenticated
/api/graphql(try/-/graphql-explorer) returned usernames, names and sometimes emails for the whole user base. - Suggestion-based reconstruction (arok.win) — with
{__schema{...}}returning “introspection is disabled”, suggestions still rebuiltQueryandMutation; the target is undocumented admin mutations (deleteUser,setRole,impersonate), UI-unselected sensitive fields and deprecated fields with weaker authz. - ArcadeDB CVE-2026-134327 — introspection is also an authorization surface. Schema listings ignored per-type ACLs, so an authenticated user denied a type could still read its property names, indexes, inheritance and materialized-view SQL through GraphQL introspection, the PostgreSQL wire catalog or MCP
get_schema. Fixed in 26.11.1. Every metadata channel must apply the same ACL as the data path (GHSA-jgxr-49x4-68p8). - Admin types in a beginner walkthrough —
{ __schema { types { name } } }exposes types such asAdmin { adminUsers, deleteUser(id) }. The finding depends on whether the resolver enforces the role, not on the type name. When the full query returns 403, the fallback is Clairvoyance-style inference from errors (securityelites).
Defenses
- Private API: disable introspection (Apollo
introspection: process.env.NODE_ENV !== 'production'; graphql-coreNoSchemaIntrospectionCustomRule). Public API: keep it but review the schema for private fields, or gate it behind authn + RBAC as Parse now does. - Hide suggestions too (Apollo Server v4+:
hideSchemaDetailsFromClientErrors; graphql-corehide_suggestions), and mask verbose errors. - Safelist operations (GraphQL Denial of Service covers persisted queries) so unknown fields are never executed.
- None of the above replaces per-resolver authorization.
Related
- GraphQL Security
- GraphQL Authorization Flaws
- GraphQL Batching Attacks
- API Discovery
- Excessive Data Exposure
- Reconnaissance
Sources
- GraphQL API Vulnerabilities · original
- GraphQL introspection: disabling it leaves the field open · original
- GraphQL Introspection Security: Lessons from the Parse Server Vulnerability · original
- Exploiting GraphQL · original
- Confirming GraphQL DAST findings: introspection, batching, depth/cost, CSRF over GET · original
- GraphQL BOLA: one object, many paths, and how to prove the gap · original
- Mass account takeover of 29,000 accounts by abusing GraphQL · original
- Overgrowth: GraphQL aliased-mutation brute force of a password reset (HI CyberCon 2026) · original
- CVE-2021-4191: GitLab GraphQL API User Enumeration (FIXED) · original
- GraphQL Cheat Sheet · original
- PayloadsAllTheThings — GraphQL Injection · original
- GraphQL - HackTricks · original
- GraphQL Security: 9 Best Practices to Protect Your API (Escape) · original
- InQL: Advanced GraphQL Security Testing Burp Extension · original
- GraphQL field suggestion abuse: rebuilding a hidden schema · original
- ArcadeDB authorization bypass (GraphQL) · original
- GraphQL Vulnerabilities Bug Bounty 2026: Introspection, Batching and BOLA · original