GraphQL Introspection: Handing Attackers Your API Map
What introspection does
GraphQL's introspection feature lets a client ask the API to describe itself — every type, field, query, and mutation. It powers helpful tools like GraphiQL and schema explorers during development. In production, it becomes a detailed map of your entire API.
Why that's a problem
With introspection enabled, an attacker doesn't have to guess how your API works. They can pull the complete schema and immediately see:
- Every query and mutation, including admin or internal ones.
- The exact shape of your data and relationships.
- Fields that hint at sensitive functionality worth probing.
It turns a black‑box target into a documented one, dramatically speeding up an attack and making authorization gaps easy to find.
Introspection is not authorization
Disabling introspection doesn't secure your API on its own — you still need proper authorization on every field. But leaving it on in production gives attackers a significant head start for no benefit to your users.
How to check and fix it
- Send an introspection query to your production endpoint. If it returns the schema, it's enabled.
- Disable introspection in production (for example,
introspection: falsein Apollo Server). - Rate‑limit and add depth/complexity limits to your GraphQL endpoint.
- Enforce authorization at the resolver level, not just in the UI.
Safeey checks it for you
Safeey actively tests common GraphQL endpoints for introspection and reports if your schema is exposed. Scan your API.
See what your site exposes
Safeey runs 1,700+ checks and shows you exactly what an attacker would find — with the fixes.
Scan your site