appsec.fyi

GraphQL — A Practical Guide

A curated AppSec resource library covering XSS, SQLi, SSRF, IDOR, RCE, XXE, OSINT, and more.

GraphQL: A Practical Guide

Curated and synthesized by . Last updated 2026-10-01. Synthesized from 115 of 115 curated resources. Browse all 115 GraphQL resources →

Problem Framing

GraphQL, a query language for APIs, has seen rapid adoption due to its flexibility in allowing clients to request precisely the data they need in a single request [1][2]. This offers significant advantages over traditional REST APIs, such as reduced over-fetching and under-fetching, leading to improved performance and developer experience [1][2]. However, this same flexibility introduces a unique and expanded attack surface that often bypasses traditional API security measures [3][4]. Understanding these GraphQL-specific vulnerabilities is crucial for application security professionals.

The core of GraphQL's appeal lies in its schema-driven design and single-endpoint architecture. Clients interact with a single URI (commonly /graphql) and define the structure of their data requests via queries and mutations [5][4]. This self-documenting nature, facilitated by introspection, can be a double-edged sword, providing invaluable insights to developers but also offering a roadmap for attackers [5][6][7].

Exploitable GraphQL vulnerabilities often stem not from the specification itself, but from implementation flaws and misconfigurations. These include improper access controls, insufficient input validation, verbose error handling, and the default enablement of features like introspection and interactive IDEs such as GraphiQL [5][8][9]. The "move fast and break things" mentality, common in modern development, can exacerbate these risks if security is not integrated early and continuously [10].

Core Mechanics

GraphQL operates fundamentally differently from REST. Instead of predefined endpoints returning fixed data structures, GraphQL clients send queries to a single endpoint, specifying precisely the data fields and relationships they require. The server then resolves these queries based on its schema [1][2].

Key components of a GraphQL API include:

Understanding these core mechanics is essential for grasping how vulnerabilities manifest and how to exploit or defend against them.

Notable Techniques

A variety of attack techniques leverage GraphQL's design to compromise security. These often exploit misconfigurations, lack of validation, or features intended for developer convenience.

Reconnaissance and Schema Enumeration

Before exploitation, attackers prioritize understanding the API's structure.

``graphql { __schema { queryType { name } mutationType { name } types { ...FullType } directives { name description locations args { ...InputValue } } } } fragment FullType on __Type { kind name description fields(includeDeprecated: true) { name description args { ...InputValue } type { ...TypeRef } } inputFields { ...InputValue } interfaces { ...TypeRef } enumValues(includeDeprecated: true) { name description } possibleTypes { ...TypeRef } } fragment InputValue on __InputValue { name description type { ...TypeRef } defaultValue } fragment TypeRef on __Type { kind name ofType { kind name ofType { kind name ofType { kind name } } } } `` [18][19][20][21][22][4][23][12]

Authorization and Access Control Flaws

GraphQL's flexibility makes robust authorization challenging.

Denial of Service (DoS) and Resource Exhaustion

GraphQL's ability to handle complex, nested, and batched queries can be exploited to overload servers.

Injection Attacks

GraphQL is susceptible to classic injection attacks when input is not properly sanitized before being passed to backend interpreters.

Cross-Site Request Forgery (CSRF)

GraphQL APIs that rely on cookies for authentication and do not enforce strict origin validation or use appropriate HTTP methods are vulnerable to CSRF [69][70][71][17][25][1][72][73]. Attackers can trick authenticated users into executing unintended mutations or queries by embedding malicious requests in a website [69][71][25]. For example, CVE-2026-19650 in GitLab involved a CSRF flaw in its GraphQL multiplex query handler, allowing mutations via GET requests [41][42][43][44].

Supply Chain Attacks

Compromises in GraphQL-related libraries or tooling can lead to widespread impact. The TanStack npm package compromise demonstrated how hijacked build pipelines and OIDC token extraction could lead to the publishing of malicious, provenance-attested packages [74].

Detection & Prevention

Securing GraphQL APIs requires a multi-layered approach, addressing both GraphQL-specific vulnerabilities and general web application security principles.

Input Validation and Sanitization

This is foundational. All user-supplied input, whether in queries, mutations, or arguments, must be rigorously validated and sanitized.

Access Control and Authorization

This is perhaps the most critical area for GraphQL security.

DoS and Query Complexity Management

Preventing resource exhaustion is vital.

Mitigating Introspection and Discoverability

Reduce the attack surface by limiting information leakage.

CSRF Protection

Secure Development Practices

Tooling

A range of tools aids in discovering, analyzing, and exploiting GraphQL vulnerabilities.

Recent Developments

The security landscape for GraphQL is continuously evolving.

Where to Go Deeper

For a more in-depth understanding and practical application of GraphQL security, consult the following resources:

Sources cited in this guide

  1. GraphQL API Vulnerabilities and Common Attacks — imperva.com
  2. GraphQL API Vulnerabilities, Common Attacks & Security Tips — vaadata.com
  3. GraphQL API Security Risks Every Developer Should Know — wiz.io
  4. GraphQL Security from a Pentester's Perspective | AFINE — afine.com
  5. GraphQL Security Testing: Introspection Abuse, Injection, and DoS — redteamworldwide.com
  6. GraphQL introspection leads to sensitive data disclosure. — medium.com
  7. GraphQL Introspection leads to Sensitive Data Disclosure. — medium.com
  8. GraphQL Security: 7 Common Vulnerabilities and Mitigations — tyk.io
  9. GraphQL Cheat Sheet | OWASP — cheatsheetseries.owasp.org
  10. GraphQL Security Testing Guide (2026) — levo.ai
  11. GraphQL Attacks and Vulnerabilities — beaglesecurity.com
  12. GraphQL - HackTricks — book.hacktricks.wiki
  13. Didn't Notice Your Rate Limiting: GraphQL Batching Attack — checkmarx.com
  14. Avoid GraphQL Denial-of-Service Attacks through Batching and Aliasing — escape.tech
  15. GraphQL Discovery: Pentesting 101 Guide — escape.tech
  16. Hacking (and Securing) GraphQL — blog.arcjet.com
  17. Exploiting GraphQL (Assetnote Research) — assetnote.io
  18. PayloadsAllTheThings — GraphQL Injection — github.com
  19. OWASP WSTG: Testing GraphQL — owasp.org
  20. Exploiting Broken Access Control on GraphQL — vaadata.com
  21. Hacking GraphQL Endpoints in Bug Bounty Programs | YesWeHack — yeswehack.com
  22. GraphQL | HackTricks — book.hacktricks.xyz
  23. Escape-Technologies/awesome-graphql-security: A curated list of awesome GraphQL Security frameworks, libraries, software and resources — github.com
  24. https://blog.assetnote.io/2021/08/29/exploiting-graphql/ — blog.assetnote.io
  25. GraphQL API Vulnerabilities - PortSwigger — portswigger.net
  26. https://github.com/gsmith257-cyber/GraphCrawler — github.com
  27. The Red Agent POV: Exploiting Broken Object-Level Authorization in an Airline GraphQL API — wiz.io
  28. The Red Agent POV: Exploiting Broken Object-Level Authorization in an Airline GraphQL API — wiz.io
  29. IDOR Vulnerability In GraphQL Api On inmobi.com — 1mirabbas.medium.com
  30. GraphQL IDOR leads to information disclosure (Eshan Singh) — medium.com
  31. GraphQL Security: How I Found and Exploited Critical IDOR and Authorization Bypass — infosecwriteups.com
  32. Bug Bounty: BAC in GraphQL (10 Major Vulns - Cloverleaf) — medium.com
  33. How a GraphQL Bug Resulted in Authentication Bypass — hackerone.com
  34. Active Exploitation Alert: Critical GitLab CVE-2026-19478 Code Injection Vulnerability Targets Unpatched Instances — rescana.com
  35. Critical GitLab vulnerability exploited days after disclosure — fieldeffect.com
  36. CVE-2026-19478: GitLab GraphQL Flaw Exploited — socradar.io
  37. GitLab Warns of Active Exploitation of Critical GraphQL Flaw — securityaffairs.com
  38. GitLab Warns of Active Exploitation of Critical GraphQL Flaw — securityaffairs.com
  39. GitLab CVE-2026-19478 Comes Under Active Exploitation Within Days of Disclosure — thehackernews.com
  40. GitLab Patches Critical CVE-2026-19478 GraphQL Vulnerability — esecurityplanet.com
  41. Critical and High-Severity GraphQL CVEs in GitLab: Code Injection and CSRF via One Directive — ox.security
  42. Critical GitLab flaw allows attackers to modify or delete public projects (CVE-2026-19478) — helpnetsecurity.com
  43. GitLab Patches Critical Code Injection Vulnerability — securityweek.com
  44. GitLab Patches Critical Unauthenticated GraphQL Vulnerability — securityaffairs.com
  45. CVE-2026-19478: Critical GitLab CE/EE GraphQL Vulnerability Enables Remote Deletion of Public Projects and User Data — rescana.com
  46. Critical GitLab GraphQL Flaw Could Let Unauthenticated Attackers Delete Public Projects — thehackernews.com
  47. "City-Forum" data-theft attacks target Salesforce ServiceNow portals — bleepingcomputer.com
  48. CVE-2021-4191: GitLab GraphQL API User Enumeration (FIXED) — rapid7.com
  49. CVE-2025-31496: GraphQL Query Vulnerability in Apollo Compiler Leading to DoS — ameeba.com
  50. Exploiting GraphQL Query Depth — checkmarx.com
  51. Apollo Router Query Planner Excessive Resource Consumption via Named Fragment Expansion (CVE-2025-32034) — github.com
  52. Cyclic Queries and Depth Limiting (Escape) — escape.tech
  53. The Complete GraphQL Security Guide: Fixing the 13 Most Common Vulnerabilities — wundergraph.com
  54. 9 Ways To Secure your GraphQL API - Apollo Checklist — apollographql.com
  55. Securing GraphQL API endpoints using rate limits and depth limits (LogRocket) — blog.logrocket.com
  56. How GraphQL Mutation Aliasing Led to a $12,500 DoS Bug in HackerOne’s Account Recovery Flow — infosecwriteups.com
  57. DoS via Mutation Aliasing in GraphQL — HackerOne Disclosure — redpacketsecurity.com
  58. Damn Vulnerable GraphQL Application — github.com
  59. BatchQL: GraphQL Security Auditing for Batch Attacks — github.com
  60. Exploiting GraphQL — blog.assetnote.io
  61. InQL: Advanced GraphQL Security Testing Burp Extension — github.com
  62. doyensec/graph-ql: GraphQL Security Research Material — github.com
  63. Hasura GraphQL 1.3.3 Local File Read via SQL Injection — vulncheck.com
  64. Discovering GraphQL endpoints and SQLi vulnerabilities — medium.com
  65. HackerOne Report #435066: SQL injection in GraphQL endpoint — hackerone.com
  66. GraphQL API Security: Common Vulnerabilities and Exploits — medium.com
  67. GraphQL - Security Overview and Testing Tips · Doyensec's Blog — blog.doyensec.com
  68. What Is API Security? — paloaltonetworks.com
  69. CVE-2025-59845: CSRF Vulnerability in Apollo Studio Embeddable Explorer and Sandbox — ameeba.com
  70. Exploiting GraphQL: Complete Guide for Bug Bounty Hunters — medium.com
  71. Exploiting CSRF in GraphQL Applications — fdzdev.medium.com
  72. Facebook GraphQL CSRF – These aren't the access_tokens you're looking for — philippeharewood.com
  73. Facebook GraphQL CSRF – These aren't the access_tokens you're looking for — philippeharewood.com
  74. TanStack npm Packages Hit by Mini Shai-Hulud — snyk.io
  75. GraphQL Introspection Security: Lessons from the Parse Server Vulnerability — escape.tech
  76. Authorization in GraphQL (Apollo) — apollographql.com
  77. Apollo Authentication and Authorization Docs — apollographql.com
  78. Enforcing GraphQL security best practices with GraphOS — apollographql.com
  79. GraphQL Security: 9 Best Practices to Protect Your API (Escape) — escape.tech
  80. Abusing GraphQL Introspection: A Gateway for Recon and Exploitation — infosecwriteups.com
  81. GraphQL Security Vulnerabilities Guide - SecPortal — secportal.io
  82. Prisma and PostgreSQL vulnerable to NoSQL injection? (Aikido) — aikido.dev
  83. Teycir/BurpAPISecuritySuite: Burp Suite extension for API security testing with 15 attack types, 108+ payloads, intelligent fuzzing, BOLA/IDOR detection, AI integration, and automated reconnaissance. Supports REST/GraphQL/SOAP APIs with Nuclei, Turbo Intruder, and external tool integration. OWASP API Top 10 coverage. — github.com
  84. br3akp0int/GQLParser: A repository for GraphQL Extension for Burp Suite — github.com
  85. doyensec/graph-ql: GraphQL Security Research Material — github.com
  86. swisskyrepo/GraphQLmap: GraphQLmap is a scripting engine to interact with a — github.com
  87. PayloadsAllTheThings - GraphQL Injection — github.com
  88. GraphQLer: Context-Aware GraphQL API Fuzzing Tool — github.com
  89. 👩‍💻Roadmap to Cybersecurity in 2022, Full-Read SSRF, IDOR in GraphQL, GCP Pentesting, and much… — infosecwriteups.com
  90. Mastering GraphQL API Pentesting: The Ultimate Resource Guide — medium.com
  91. Mastering the Realm of GraphQL Exploitation — medium.com
  92. GraphQL IDOR leads to information disclosure - Eshan Singh - Medium — medium.com
📚 This guide is synthesized from the full text of resources curated in the GraphQL library, and refreshed as new material is added.