How to fix: GraphQL IDE served in production
This endpoint serves an interactive GraphQL IDE: a schema browser and a query editor for this API. GraphiQL, GraphQL Playground, Apollo Sandbox, Voyager and the Hasura console are all development tools, and every one of them is meant to be switched off outside development.
Why it matters
The IDE gives anyone who finds the endpoint a full schema browser plus a request builder pointed at your production API, with your visitor's own cookies attached. Enumerating the write surface, discovering fields the frontend never calls, and iterating on an authorization bypass all stop needing any tooling of the attacker's own.
The detector matches structural markers only: the IDE's own bundle filename, its document title, or the function that renders it (GraphiQL.createFetcher, renderGraphiQL, ApolloServerPluginLandingPage). A page that mentions these products in prose does not match, so documentation and marketing pages do not fire it. Note that serving the IDE and enabling introspection are separate switches: turning off one does not turn off the other.
How to fix it
- 1Disable the IDE plugin in production. In Apollo Server, pass ApolloServerPluginLandingPageDisabled() rather than relying on NODE_ENV alone.
- 2In express-graphql / graphql-http, set graphiql to false when the environment is not development.
- 3For Hasura, do not deploy with HASURA_GRAPHQL_ENABLE_CONSOLE=true; run the console locally against the remote endpoint instead.
- 4Disable schema introspection at the same time, since the IDE and introspection are controlled independently.
Code examples
Apollo Server: disable the landing page in production
import {
ApolloServerPluginLandingPageDisabled,
ApolloServerPluginLandingPageLocalDefault,
} from '@apollo/server/plugin/landingPage/default';
const isProd = process.env.NODE_ENV === 'production';
new ApolloServer({
schema,
introspection: !isProd,
plugins: [
isProd
? ApolloServerPluginLandingPageDisabled()
: ApolloServerPluginLandingPageLocalDefault(),
],
});graphql-http: gate GraphiQL on the environment
app.all(
'/graphql',
createHandler({
schema,
graphiql: process.env.NODE_ENV !== 'production',
}),
);References
Detected automatically by VulnRadar. The check id is api-graphql-ide-exposed, 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 IDE served in production?
- VulnRadar rates this medium 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-ide-exposed, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does GraphQL IDE served in production map to?
- It maps to CWE-489. 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.