GraphQL Introspection Enabled

The GraphQL endpoint answers introspection queries in production, returning its complete schema: every query, mutation, type and field, including ones the client never uses.

SeverityInformational
CVSS 3.10 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N Open in the calculator
CVSS 4.00 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:N/SA:N Open in the calculator
CWECWE-497: Exposure of Sensitive System Information to an Unauthorized Control Sphere
OWASP Top 10A01:2025 Broken Access Control
MITRE ATT&CKT1595 Active Scanning
CategoryInformation Disclosure

Description

GraphQL includes an introspection system that lets a client ask the server for its schema, through queries on the __schema and __type fields. Development tools such as GraphiQL rely on it, and many server implementations enable it by default.

The production endpoint answers introspection queries from unauthenticated or ordinary users, and so gives an attacker a full description of the API: a complete map of every query, mutation and subscription with its arguments, and of every type and field. That includes deprecated, internal and administrative operations and fields, and debugging queries, that the client application never calls and that are often less well protected, so the map removes much of the effort of discovering the attack surface and points directly to the operations most worth testing for authorisation flaws. Introspection does not give access to any data or operation by itself, as every operation it reveals still enforces whatever authorisation the server applies, but its significance rises where the schema reveals operations that prove to be exploitable.

The weakness is identified by sending a standard introspection query to the GraphQL endpoint and checking whether the schema is returned. Tools such as InQL for Burp Suite and GraphQL Voyager, and most API scanners, send this query automatically, and scanners report the result as GraphQL introspection enabled. Endpoints are commonly found at paths such as /graphql, /api/graphql or /v1/graphql.

Remediation

Disable introspection in production, or restrict it to trusted users:

  • Turn introspection off in the production configuration, for example with the introspection: false option in Apollo Server, the NoSchemaIntrospectionCustomRule validation rule in servers built on graphql-js, or disable_introspection_entry_points in graphql-ruby. Other implementations offer equivalent settings.
  • Where internal developers or partners need the schema, provide it through documentation or a separate, authenticated environment, or allow introspection only for authenticated staff roles.
  • Disable GraphiQL, GraphQL Playground and similar interactive tools in production.
  • Disable field suggestions as well, since they allow much of the schema to be recovered when introspection is off.
  • Treat this as hardening: enforce authorisation in the resolvers of every sensitive query, mutation and field, so that knowledge of the schema gives no access.

Confirm the fix by sending the introspection query again, unauthenticated and as an ordinary user, and checking that the schema is no longer returned.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More APIs Findings

Every APIs finding