How to fix: GraphQL introspection exposes a mutation-heavy schema
The GraphQL introspection response doesn't just confirm introspection is enabled, it resolves a "Mutation" root type with five or more distinct mutation fields, meaning the entire write surface of the API, not only its read schema, is enumerable by any caller.
Why it matters
An attacker gets the exact name, arguments, and return type of every mutation, createUser, deleteAccount, grantRole, whatever exists, without probing or guessing field names first. A data-model leak becomes a ready-made target list of every write operation the API exposes, prioritizing which ones to attack first.
Builds on the base introspection-enabled check by requiring an actually resolved schema (a real "__schema" object, not just the introspection query text) and specifically locating the "Mutation" OBJECT type's own "fields" array. Field names are counted only at that array's top level, distinguishing genuine mutation field entries from the "name" keys that also appear on each field's nested argument and return-type objects, so the count reflects real mutations rather than incidental "name" occurrences.
How to fix it
- 1Disable introspection in production (Apollo: introspection: false, GraphQL.NET: ExposeMetadata = false)
- 2If internal tooling needs introspection, gate it behind authentication rather than leaving it open to any caller
- 3Review the full mutation list for operations that should never have been reachable without authorization (admin-only actions, destructive operations) and add field-level auth checks
Code examples
Apollo Server 4: disable introspection in production
import { ApolloServer } from '@apollo/server';
const server = new ApolloServer({
typeDefs,
resolvers,
introspection: process.env.NODE_ENV !== 'production',
});References
Detected automatically by VulnRadar. The check id is api-graphql-introspection-mutation-heavy, stable across every scan so you can filter or diff on it.
More api checks
- LowTRACE method referenced in API response body
- InfoREST endpoint allows DELETE
- LowGraphQL introspection field suggestions
- MediumGraphQL endpoint has no rate-limit headers
- LowOpenAPI server URL leaks internal host
- LowCORS preflight result not cached
- HighBearer token in URL query string
- MediumJSONP callback parameter accepted
Questions
- How severe is GraphQL introspection exposes a mutation-heavy schema?
- VulnRadar rates this high severity in the api category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
- Does VulnRadar check for this automatically?
- Yes. It runs as part of every scan under the check id api-graphql-introspection-mutation-heavy, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does GraphQL introspection exposes a mutation-heavy schema map to?
- It maps to CWE-200. In the OWASP Top 10 it falls under A05:2021.
Missing a check?
The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.