GraphQL Introspection

The spec-defined __schema / __type meta-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”

TechniqueWhat it exploits
Regex-filter bypassFilters that match __schema{ miss __schema followed by newline, space or comma, which the GraphQL lexer ignores
Alternate transportIntrospection blocked only on JSON POST; retry as GET /graphql?query=query%7B__schema%0A%7BqueryType%7Bname%7D%7D%7D or form-urlencoded POST
Field suggestionsCannot 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 harvestSeed 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 oracleWith 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 artifactsOperations seen in proxy history and persisted/bundled queries in front-end JS give real field and argument names
Engine fingerprintgraphw00f (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 node

Why “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 graphQLPublicIntrospection opt-out.
  • Mass ATO of 29,000 accounts — production introspection revealed an undocumented tokenForgotPasswords query 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 resetPassword and 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 rebuilt Query and Mutation; 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 as Admin { 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-core NoSchemaIntrospectionCustomRule). 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-core hide_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.

Sources