Case C9F7C5 · Web AppSec · L3 Applied
Attacking and Defending GraphQL
- 01 Context
- 02 Mechanism
- 03 Lessons
What a strong answer covers
Try it out loud first. Then check yourself:
- One endpoint, client-shaped queries: introspection maps the whole schema; field suggestions leak it even when disabled
- Authorization must be enforced per resolver or field; a check only on the top-level query leaves nested objects open (BOLA)
- Aliases and batched queries pack hundreds of operations in one request, bypassing per-request rate limits on login or OTP
- Deeply nested or circular queries cause resource exhaustion; use depth and cost limits, timeouts and pagination caps
- Lessons: disable introspection in prod, prefer persisted query allowlists, and reject GET or form-encoded mutations (CSRF)
If the interviewer pushes back
- How would you rate-limit a GraphQL API meaningfully when every request hits the same URL?