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-06-29. Synthesized from 102 of 102 curated resources. Browse all 102 GraphQL resources →

The GraphQL Attack Surface

GraphQL, a query language for APIs developed by Facebook, has gained significant traction due to its efficiency and flexibility in data fetching [1][2][3]. Unlike REST's multiple endpoints for various resources, GraphQL typically exposes a single endpoint where clients can precisely define the data they need in a single request [3][4]. This schema-driven approach, while powerful for developers, introduces a distinct set of security challenges and a unique attack surface. Understanding these vulnerabilities is critical for application security professionals tasked with defending these systems.

Core Mechanics of GraphQL Security Risks

At its heart, GraphQL's security risks stem from its inherent flexibility and the way it exposes data and operations. The core of this lies in the schema, which defines all available types, fields, queries, and mutations [1]. Without proper controls, this rich introspection capability can be a significant advantage for attackers [5][6].

The dynamic nature of GraphQL queries means that clients have a high degree of control over the data fetched. This can lead to issues like:

Notable Techniques and Vulnerabilities

A wide array of vulnerabilities have been documented targeting GraphQL APIs. Understanding these common attack vectors is paramount for effective security assessments.

Introspection Abuse

GraphQL introspection allows clients to query the schema, providing detailed metadata about types, fields, and operations [16][2]. When enabled in production, this feature provides attackers with a comprehensive map of the API's attack surface, including potential entry points for further exploitation [15][6][5]. Attackers can use tools like GraphQL Voyager to visualize the schema and identify high-value targets [16][2]. Even when introspection is disabled, field suggestions in error messages can aid schema reconstruction [21][2][3].

{

__schema { types { name fields { name } } } }

Denial of Service (DoS) and Resource Exhaustion

GraphQL's flexibility in query construction can be a double-edged sword. Maliciously crafted queries can lead to significant resource consumption:

A specific example of a DoS vulnerability was found in HackerOne's account recovery flow due to mutation aliasing [23]. GitLab has also seen DoS vulnerabilities related to Duo AI features [26][27]. Apollo Compiler experienced a DoS vulnerability (CVE-2025-31496) due to named fragment expansion [28][29].

Authorization and Access Control Flaws

GraphQL APIs are susceptible to broken access control, a perennial OWASP Top Ten concern [13][10][30][9]. This can manifest in several ways:

A vulnerability in GitLab allowed authenticated users to trigger Duo AI workflows under another user's identity due to improper user identity resolution [27].

Injection Attacks

As with any API accepting user-supplied input, GraphQL is vulnerable to various injection attacks. The risk is amplified when arguments are directly incorporated into backend queries or commands without proper sanitization or parameterization [11][12].

Cross-Site Request Forgery (CSRF)

GraphQL APIs, especially those using cookies for authentication and accepting GET requests or non-JSON POST requests, can be vulnerable to CSRF. Attackers can trick users into performing unintended actions by embedding malicious GraphQL requests in other sites [39][40][21][41][42][43][44][45].

Other Vulnerabilities

Detection and Prevention Strategies

Mitigating GraphQL vulnerabilities requires a multi-layered approach focusing on secure development practices, robust configuration, and continuous monitoring.

Secure Schema Design and Introspection Management

Input Validation and Sanitization

Access Control Enforcement

DoS and Resource Limiting

CSRF Protection

Tooling for GraphQL Security Testing

A variety of specialized tools aid in the security assessment of GraphQL APIs:

Recent Developments

The GraphQL ecosystem continues to evolve, with ongoing efforts to enhance security. Recent developments highlight a focus on:

Where to Go Deeper

For those looking to deepen their expertise in GraphQL security, several resources are invaluable:

Sources cited in this guide

  1. GraphQL API Vulnerabilities, Common Attacks & Security Tips — vaadata.com
  2. Hacking GraphQL Endpoints in Bug Bounty Programs | YesWeHack — yeswehack.com
  3. GraphQL Security from a Pentester's Perspective | AFINE — afine.com
  4. GraphQL API Vulnerabilities and Common Attacks — imperva.com
  5. GraphQL Security Testing: Introspection Abuse, Injection, and DoS — redteamworldwide.com
  6. Abusing GraphQL Introspection: A Gateway for Recon and Exploitation — infosecwriteups.com
  7. Exploiting GraphQL Query Depth — checkmarx.com
  8. Cyclic Queries and Depth Limiting (Escape) — escape.tech
  9. GraphQL Security Testing Guide (2026) — levo.ai
  10. GraphQL API Security Risks Every Developer Should Know — wiz.io
  11. GraphQL Cheat Sheet | OWASP — cheatsheetseries.owasp.org
  12. Hacking (and Securing) GraphQL — blog.arcjet.com
  13. Exploiting Broken Authentication Control in GraphQL — praetorian.com
  14. Authorization in GraphQL (Apollo) — apollographql.com
  15. GraphQL Introspection Security: Lessons from the Parse Server Vulnerability — escape.tech
  16. OWASP WSTG: Testing GraphQL — owasp.org
  17. Didn't Notice Your Rate Limiting: GraphQL Batching Attack — checkmarx.com
  18. Avoid GraphQL Denial-of-Service Attacks through Batching and Aliasing — escape.tech
  19. DoS via Mutation Aliasing in GraphQL — HackerOne Disclosure — redpacketsecurity.com
  20. GraphQL Security: 7 Common Vulnerabilities and Mitigations — tyk.io
  21. Exploiting GraphQL (Assetnote Research) — assetnote.io
  22. GraphQL Security: 9 Best Practices to Protect Your API (Escape) — escape.tech
  23. How GraphQL Mutation Aliasing Led to a $12,500 DoS Bug in HackerOne’s Account Recovery Flow — infosecwriteups.com
  24. BatchQL: GraphQL Security Auditing for Batch Attacks — github.com
  25. Exploiting GraphQL — blog.assetnote.io
  26. GitLab Patches Multiple Duo AI DoS and Authorization Flaws in Community and Enterprise Edition — cybersecuritynews.com
  27. GitLab Patches Multiple Duo AI DoS and Authorisation Vulnerabilities — gbhackers.com
  28. CVE-2025-31496: GraphQL Query Vulnerability in Apollo Compiler Leading to DoS — ameeba.com
  29. Apollo Router Query Planner Excessive Resource Consumption via Named Fragment Expansion (CVE-2025-32034) — github.com
  30. Exploiting Broken Access Control on GraphQL — vaadata.com
  31. IDOR Vulnerability In GraphQL Api On inmobi.com — 1mirabbas.medium.com
  32. GraphQL IDOR leads to information disclosure (Eshan Singh) — medium.com
  33. GraphQL Security: How I Found and Exploited Critical IDOR and Authorization Bypass — infosecwriteups.com
  34. GraphQL Introspection leads to Sensitive Data Disclosure. — medium.com
  35. GraphQL IDOR leads to information disclosure - Eshan Singh - Medium — medium.com
  36. How a GraphQL Bug Resulted in Authentication Bypass — hackerone.com
  37. Prisma and PostgreSQL vulnerable to NoSQL injection? (Aikido) — aikido.dev
  38. Hasura GraphQL 1.3.3 Local File Read via SQL Injection — vulncheck.com
  39. CVE-2025-59845: CSRF Vulnerability in Apollo Studio Embeddable Explorer and Sandbox — ameeba.com
  40. Exploiting CSRF in GraphQL Applications — fdzdev.medium.com
  41. GraphQL API Vulnerabilities - PortSwigger — portswigger.net
  42. Facebook GraphQL CSRF – These aren't the access_tokens you're looking for — philippeharewood.com
  43. [TOKOPEDIA] SITE-WIDE CSRF THROUGH GRAPHQL REQUEST — rafiem.github.io
  44. Facebook GraphQL CSRF – These aren't the access_tokens you're looking for — philippeharewood.com
  45. [TOKOPEDIA] SITE-WIDE CSRF THROUGH GRAPHQL REQUEST — rafiem.github.io
  46. TanStack npm Packages Hit by Mini Shai-Hulud — snyk.io
  47. Escape-Technologies/awesome-graphql-security: A curated list of awesome GraphQL Security frameworks, libraries, software and resources — github.com
  48. 9 Ways To Secure your GraphQL API - Apollo Checklist — apollographql.com
  49. Apollo Authentication and Authorization Docs — apollographql.com
  50. Securing GraphQL API endpoints using rate limits and depth limits (LogRocket) — blog.logrocket.com
  51. GraphQL | HackTricks — book.hacktricks.xyz
  52. swisskyrepo/GraphQLmap: GraphQLmap is a scripting engine to interact with a — github.com
  53. PayloadsAllTheThings - GraphQL Injection — github.com
  54. InQL: Advanced GraphQL Security Testing Burp Extension — github.com
  55. 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
  56. br3akp0int/GQLParser: A repository for GraphQL Extension for Burp Suite — github.com
  57. doyensec/graph-ql: GraphQL Security Research Material — github.com
  58. PayloadsAllTheThings — GraphQL Injection — github.com
  59. https://blog.assetnote.io/2021/08/29/exploiting-graphql/ — blog.assetnote.io
  60. https://github.com/gsmith257-cyber/GraphCrawler — github.com
  61. Damn Vulnerable GraphQL Application — github.com
  62. DarkMoon AI-Powered Autonomous Penetration Testing Platform With 50 Tools — cybersecuritynews.com
  63. Enforcing GraphQL security best practices with GraphOS — apollographql.com
  64. GraphQL API Vulnerabilities Learning Path — PortSwigger — portswigger.net
  65. Exploiting GraphQL for Penetration Testing (Raxis) — raxis.com
  66. CVE-2021-4191: GitLab GraphQL API User Enumeration (FIXED) — rapid7.com
  67. API Threat Research: GraphQL Authorization Flaws in a FinTech Platform — salt.security
  68. Discovering GraphQL endpoints and SQLi vulnerabilities — medium.com
  69. HackerOne Report #435066: SQL injection in GraphQL endpoint — hackerone.com
  70. Exploiting GraphQL: Complete Guide for Bug Bounty Hunters — medium.com
  71. Exploiting GraphQL for fun and bounties (BugBase) — bugbase.ai
  72. GraphQL for Bug Bounty (Mudhalai Mr) — medium.com
  73. Bug Bounty: BAC in GraphQL (10 Major Vulns - Cloverleaf) — medium.com
  74. Exploiting GraphQL Vulnerabilities: Misconfig to Data Leaks — dev.to
  75. GraphQL Vulnerabilities Cheat Sheet — 0xn3va.gitbook.io
  76. GraphQL Discovery: Pentesting 101 Guide — escape.tech
  77. GraphQL Pentesting: Beginner's Guide to Advanced — medium.com
  78. The Complete GraphQL Security Guide: Fixing the 13 Most Common Vulnerabilities — wundergraph.com
  79. Exploiting GraphQL: A Full-Spectrum Security Assessment — kizerh.medium.com
  80. Common Attacks on REST APIs and GraphQL APIs — medium.com
  81. GraphQL API Security: Common Vulnerabilities and Exploits — medium.com
  82. GraphQL Attacks and Vulnerabilities — beaglesecurity.com
  83. Top GraphQL Security Vulnerabilities: Analyzing 1,500+ Endpoints — konghq.com
  84. GraphQL Security Flaws and Exploitation — infosecwriteups.com
  85. GraphQL Security Vulnerabilities Guide - SecPortal — secportal.io
  86. GraphQL Security Complete Guide | Payload Playground — payloadplayground.com
  87. GraphQL Vulnerabilities and Common Attacks Seen in the Wild | Imperva — imperva.com
  88. GraphQL - Security Overview and Testing Tips · Doyensec's Blog — blog.doyensec.com
  89. GraphQL introspection leads to sensitive data disclosure. — medium.com
  90. doyensec/graph-ql: GraphQL Security Research Material — github.com
  91. GraphQL - HackTricks — book.hacktricks.wiki
  92. 👩‍💻Roadmap to Cybersecurity in 2022, Full-Read SSRF, IDOR in GraphQL, GCP Pentesting, and much… — infosecwriteups.com
  93. Mastering GraphQL API Pentesting: The Ultimate Resource Guide — medium.com
  94. Mastering the Realm of GraphQL Exploitation — medium.com
  95. Slides: GraphQL Hacking — rashahacks.com
  96. Favorite tweet by @harshbothra_ — twitter.com
📚 This guide is synthesized from the full text of resources curated in the GraphQL library, and refreshed as new material is added.