GraphQL introspection disabled in production
Why it matters
GraphQL introspection exposes your complete API schema — every type, field, mutation, and query — to anyone who can reach the endpoint. OWASP API Security Top 10 2023 API8 (Security Misconfiguration) and CWE-200 (Exposure of Sensitive Information) both flag introspection as an information disclosure risk. Attackers use introspection to map internal data models, identify admin mutations, discover deprecated endpoints, and understand field naming conventions before crafting targeted queries. In a production API, the schema is sensitive internal documentation. Development environments may leave introspection on by default; that default should be explicitly disabled when deploying to production.
Severity rationale
Low because introspection is an information disclosure risk, not a direct exploitation path — but it systematically reduces the effort required to find and exploit other vulnerabilities.
Remediation
Disable introspection in production by gating it on NODE_ENV. If schema exploration is needed for internal teams, restrict it behind authentication rather than removing it entirely.
// Apollo Server v4
import { ApolloServer } from '@apollo/server'
const server = new ApolloServer({
schema,
introspection: process.env.NODE_ENV !== 'production',
// Also disable the Explorer landing page in production
plugins: process.env.NODE_ENV === 'production'
? [ApolloServerPluginLandingPageDisabled()]
: [ApolloServerPluginLandingPageLocalDefault()]
})
For authenticated introspection, add a validation rule that checks context.user?.role === 'admin' before permitting __schema queries.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the API Security Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-200 — Exposure of Sensitive Information to an Unauthorized Actor
- owasp:2021 · A05 — Security Misconfiguration
- owasp:2023 · API8 — Security Misconfiguration
- soc2:2017 · CC6.6 — Protection against threats from outside system boundaries
Taxons
History
- 2026-04-18·v1.0.0·Initial import from api-security·automated
- 2026-07-06·v1.0.1·Add SOC 2 TSC mapping (CC6.6) from the verified compliance crosswalk register (docs/compliance/).·by soc2-mapping-enrichment-ship-2