# GraphQL Security
> GraphQL collapses an API into one endpoint driven by a client-controlled query language, so the classic API bugs (BOLA, broken authn, injection) persist while schema exposure, query shape, batching and transport leniency add GraphQL-native ones.
## What it is
GraphQL is not a vulnerability class; it is an API style whose design moves several trust decisions onto the server that REST gets "for free" from URLs and HTTP verbs:
| REST assumption | What GraphQL does instead | Resulting bug family |
|---|---|---|
| One URL per resource, so WAF rules, authz and rate limits can key on the path | One endpoint (`/graphql`); the operation lives in the body | Path-based controls see nothing; [[GraphQL Batching Attacks]] |
| Server decides response size | Client chooses depth, aliases, fragments and list sizes | [[GraphQL Denial of Service]] |
| Attack surface must be discovered | Schema is self-describing via introspection and verbose validation errors | [[GraphQL Introspection]] |
| Authz attaches to a route | Spec defines no authz; every field is a resolver and an object is reachable via many paths | [[GraphQL Authorization Flaws]] |
| Verb + content type constrain the browser | Many servers also execute GET and form-encoded POST | [[GraphQL CSRF]] |
| One request/response transport | Subscriptions run over WebSocket, SSE or multipart with separate auth | [[GraphQL Subscription Security]] |
The broken trust boundary is almost always the same: **the server trusts the shape of the client's document** (which paths it traverses, how many operations it packs, which transport carries it) to stand in for a check that should run per resolver, per object and per principal ([[raw/cheatsheetseries.owasp.org/graphql-cheat-sheet-owasp-2815|OWASP cheat sheet]], [[raw/dev.to/graphql-bola-one-object-many-paths-and-how-to-prove-the-gap-14345|One object, many paths]]). Resolvers are ordinary code, so typed arguments still land in SQL, ORMs, format strings and URLs unchanged ([[GraphQL Injection]]).
## Why it matters
An Escape scan of 1,500+ GraphQL endpoints found ~40% of issues were classic API flaws (broken authentication and access control), and verbose error handling leaked internal API keys and cloud/SaaS tokens ([[raw/konghq.com/top-graphql-security-vulnerabilities-analyzing-1-500-endpoints-3125|Analyzing 1,500+ endpoints]]). GraphQL-specific configuration findings (introspection on, aliases allowed, GET accepted) are **preconditions**, not impact; triagers expect a demonstrated consequence ([[raw/dedsecops.com/confirming-graphql-dast-findings-introspection-batching-depth-cost-csr-14495|DedSec: confirming DAST findings]]).
**Impact ladder** (prove the highest rung):
1. **Schema / metadata disclosure** — introspection, suggestions, error-leaked secrets. Low on its own.
2. **Enumeration and brute force** — user enumeration (GitLab CVE-2021-4191), OTP/reset-code brute force via aliases ([[raw/rapid7.com/cve-2021-4191-gitlab-graphql-api-user-enumeration-fixed-9502|Rapid7]]).
3. **Cross-user / cross-tenant data access** — BOLA through alternate paths, aggregates, shared caches ([[GraphQL Authorization Flaws]]).
4. **State change as another user** — IDOR mutations, CSRF over GET, payment-as-victim.
5. **[[Account Takeover]] at scale** — 29,000 accounts via an introspected `tokenForgotPasswords` query ([[raw/medium.com/mass-account-takeover-of-29-000-accounts-by-abusing-graphql-13886|Mass ATO]]).
6. **Secrets / code execution** — Arize Phoenix f-string reading `os.environ` (CVSS 10.0), GitLab directive code injection (CVSS 9.4).
**Severity drivers:** unauthenticated reach; whether the bug sits in the engine/gateway (every deployment affected) or one resolver; cookie vs bearer auth (CSRF relevance); presence of an operation safelist; whether the target operation guards a secret (OTP, token, password).
**In the wild:** GitLab CVE-2026-19478 was exploited within days of disclosure ([[raw/thehackernews.com/gitlab-cve-2026-19478-comes-under-active-exploitation-within-days-of-d-11600|THN]]); the "City-Forum" campaign pulls data exposed to unauthenticated guest users through Salesforce LWR's `/webruntime/api/services/data/{version}/graphql` and Aura endpoints — misconfiguration, not a platform CVE ([[raw/bleepingcomputer.com/city-forum-data-theft-attacks-target-salesforce-servicenow-portals-11899|BleepingComputer]]).
## How it works
### Schema exposure → [[GraphQL Introspection]]
`__schema` / `__type` return every query, mutation, subscription, argument and enum. When it is "off", the schema still leaks through regex-filter gaps (`__schema` followed by newline/space/comma), alternate transports (GET, form POST), `Did you mean 'setRole'?` suggestions, error-shape oracles, client JS bundles and persisted queries ([[raw/portswigger.net/graphql-api-vulnerabilities-web-security-academy-2745|PortSwigger]], [[raw/excessionlabs.ai/graphql-introspection-disabling-it-leaves-the-field-open-14206|Excession Labs]]). Defaults matter: Apollo Server enables introspection unless `NODE_ENV=production`; graphql-core leaves suggestions on.
Suggestion leakage is enough on its own: a near-miss root field (`{ usr { id } }` → `Did you mean "user" or "users"?`) or argument (`user(i: 1)` → `Did you mean "id"?`) recovers names recursively, and the prize is the hidden mutation list, since admin mutations the UI never calls routinely carry weaker authorization ([[raw/blog.arok.win/graphql-field-suggestion-abuse-rebuilding-a-hidden-schema-15821|arok.win]]).
### Access control → [[GraphQL Authorization Flaws]]
A check written into `Query.invoice(id)` must be repeated on `node(id)`, search unions, `User.invoices`, aggregates, sibling `prev`/`next` edges and mutation payloads ([[raw/dev.to/graphql-bola-one-object-many-paths-and-how-to-prove-the-gap-14345|One object, many paths]]). Relay IDs are base64 of `Type:id` (`SW52b2ljZToxMDQy` → `Invoice:1042`), not secrets. Declarative authz (graphql-ruby `authorized?`, @neo4j/graphql `@authentication`) moves the bug into the library. This is GraphQL's form of [[BOLA in APIs]] and [[Function Level Authorization]].
### Subscriptions → [[GraphQL Subscription Security]]
Authentication happens once in `connectionParams` of `ConnectionInit`; failures include trusting decoded client claims, gateways leaking one caller's `connectionParams` to another, HTTP SSE/multipart bypassing the WebSocket gateway, per-event filtering applied only to the first notification of a batch, and no teardown on token expiry.
### Batching → [[GraphQL Batching Attacks]]
Aliases, JSON-array batching and multiple named operations pack N operations into one HTTP request; limiters that count requests (e.g. 60 req/min/IP at Cloudflare/NGINX) see one event ([[raw/bipi.in/graphql-batching-abuse-and-how-to-stop-it-14646|bipi.in]], [[raw/escape.tech/avoid-graphql-denial-of-service-attacks-through-batching-and-aliasing-4767|Escape]]):
```graphql
mutation {
a1: checkCode(code:"0000") { ok }
a2: checkCode(code:"0001") { ok }
# ... aN
}
```
Batching is also an authz problem: Hive Gateway's batch-execute bug confused context between batched requests ([[raw/guide.sonatype.com/graphql-hive-gateway-batch-execute-authorization-bypass-13388|Sonatype]]).
Array batching also sidesteps **per-query** cost limits: Saleor enforced complexity per operation but put no cap on the number of operations in a JSON array, so one unauthenticated request exhausted CPU, DB connections and uvicorn workers ([[raw/github.com/saleor-dos-via-unbounded-graphql-query-batching-15819|GHSA-24jw-f244-qfpp]]). The two forms are not interchangeable in practice: one voucher endpoint tolerated 50 array entries but returned 504s and node timeouts at 5,000 aliases ([[raw/medium.com/graphql-alias-batching-bypasses-rate-limiting-15820|alias batching vs voucher limit]]).
### Resource exhaustion → [[GraphQL Denial of Service]]
Cyclic edges (`album{songs{album{songs...}}}`), unbounded `limit`/`first`, alias and field duplication, directive overloading, fragment expansion and N+1 fan-out; plus parser/validator/planner bugs that fire before any resolver (Apollo Router CVE-2025-32034, Apollo Compiler CVE-2025-31496, graphql-core CVE-2026-119286) ([[raw/escape.tech/cyclic-queries-and-depth-limiting-escape-4402|Escape: cyclic queries]]).
Transport limits count too: SurrealDB's `GET /graphql` WebSocket upgrade never bound the operator's `SURREAL_WEBSOCKET_MAX_MESSAGE_SIZE` and buffer limits that `/rpc` and `/sql` applied, so unauthenticated connections inherited tungstenite defaults (64 MiB/message, unbounded write buffer) ([[GraphQL Subscription Security]], [[raw/github.com/surrealdb-graphql-websocket-missing-size-limits-memory-amplification-15822|GHSA-p3c2-wh5f-jwqm]]).
### Injection → [[GraphQL Injection]]
Scalar types check shape only. Sinks: SQL in resolvers ([[SQL Injection]]), ORM operator objects (Prisma, see [[NoSQL Injection]] / [[ORM Injection]]), Python `str.format()`, directive handling, string-built downstream GraphQL documents, `__proto__` in `@defer`/`@stream` merges, filesystem paths, URL arguments ([[Server-Side Request Forgery]]), stored fields rendered by the front end ([[Cross-Site Scripting]]).
### Transport → [[GraphQL CSRF]]
`application/json` POST preflights; GET, `x-www-form-urlencoded` and `text/plain` POST do not. A server that executes mutations from those is a [[Cross-Site Request Forgery]] target; `SameSite=Lax` cookies still ride top-level GET navigations ([[raw/dedsecops.com/confirming-graphql-dast-findings-introspection-batching-depth-cost-csr-14495|DedSec]], [[raw/fdzdev.medium.com/exploiting-csrf-in-graphql-applications-4180|fdzdev]]). The GraphQL-over-HTTP draft says GET MUST NOT execute mutations.
## Where to find it
- **Endpoints:** `/graphql`, `/api`, `/api/graphql`, `/graphql/api`, `/graphql/graphql`, each also with `/v1`; IDEs and debug paths such as `/graphiql`, `/graphql.php?debug=1`, GitLab's `/-/graphql-explorer`; vendor paths like Salesforce LWR `/webruntime/api/services/data/{version}/graphql` and Directus `/graphql/system` ([[raw/portswigger.net/graphql-api-vulnerabilities-web-security-academy-2745|PortSwigger]], [[raw/book.hacktricks.wiki/graphql-hacktricks-5084|HackTricks]], [[raw/blog.assetnote.io/exploiting-graphql-435|Assetnote]]). See [[API Discovery]].
- **Universal probe:** `query{__typename}` → `{"data":{"__typename":"Query"}}`; retry with GET and form-encoded POST.
- **Client artifacts:** operations in proxy history, persisted-query hashes and documents in JS bundles, mobile apps.
- **Schema hotspots:** `node`/`nodes`, search unions and interfaces, aggregate/count fields, connection filters and ordering, mutation payload types, any argument naming a user/org/role (`userId`, `username`, `role`), URL/template/path arguments, subscription fields.
- **Auth-adjacent operations:** `login`, OTP/2FA/reset-code checks, coupon/invite validators, account recovery, password change.
- **Framework layer:** gateways and routers (Apollo Router, Hive Gateway, GraphQL Mesh, Kong plugins), executors (graphql-tools), authz libraries (graphql-ruby, @neo4j/graphql), CMS GraphQL modules (WPGraphQL, Craft, Drupal graphql_core_schema, Directus, TinaCMS), dev tools (Apollo Sandbox, Cypress Launchpad). Fingerprint before testing logic.
## How to test
1. **Find and fingerprint.** Probe the endpoint list with `__typename`; run graphw00f (or InQL's fingerprinter) for engine and version, then check that engine's defaults and CVEs ([[raw/redamon.org/graphql-security-testing-introspection-and-graphql-cop-15485|Redamon]]).
2. **Recover the schema.** Full `IntrospectionQuery` (strip legacy `onOperation`/`onFragment`/`onField` if rejected) → regex/transport bypasses → Clairvoyance on suggestions → error-shape wordlists → client operations ([[GraphQL Introspection]]).
3. **Mine it.** GraphQL Voyager for relationships; graphql-path-enum for every path to a sensitive type; spot `node` entry points:
```bash
jq '.data.__schema.types[] | select(.name=="Query") | .fields[] | .name' schema.json | grep node
```
4. **Authorization matrix.** Two tenants × two roles; every path, field and principal-naming argument; aliases to fire all paths for one object in one request; read `data` and `errors`, not HTTP status (errors ride in 200) ([[raw/dev.to/graphql-bola-one-object-many-paths-and-how-to-prove-the-gap-14345|One object, many paths]]). Automate replay with GraphQLer or [[Authorization Testing Automation]].
5. **Batching.** Resend each rate-limited operation as 10/100/1,000 aliases and as an array; check whether lockouts and limiters fire per request or per attempt; check client influence on keyspace (code length).
6. **Cost/depth** on staging only, with permission: step depth on cycles, then probe aliases, tokens, list caps, fragments and directives independently — a depth limit is not a cost limit ([[raw/dedsecops.com/confirming-graphql-dast-findings-introspection-batching-depth-cost-csr-14495|DedSec]]).
7. **Transport.** GET and form-encoded execution, content-type enforcement, cookie vs bearer auth, `SameSite` attributes; every subscription transport (WebSocket subprotocols, SSE, multipart).
8. **Injection.** Fuzz every string argument and input-object field, plus URL params, headers and persisted-query variables; use boolean/time oracles when errors are masked.
9. **Baseline automation.** graphql-cop for misconfigs and DoS-class checks; InQL scanner; GraphQLer or Schemathesis (4.33+ GraphQL coverage phase) for schema-aware fuzzing; see [[API Fuzzing]].
**Checklist**
- [ ] `__typename` answered on JSON POST, GET and form POST
- [ ] Engine + version identified; known CVEs checked
- [ ] Introspection, suggestions and error verbosity recorded (precondition only)
- [ ] Every path to each sensitive type enumerated and tested cross-tenant
- [ ] `node(id)`, aggregates, filters, `prev`/`next`, mutation payloads tested
- [ ] Principal-naming arguments (`userId`, `username`, `role`) swapped
- [ ] Alias and array batching against login, OTP, reset, coupon operations
- [ ] Depth, alias, token, list-size and fragment limits probed (staging)
- [ ] Mutations via GET / form POST with cookie auth
- [ ] Subscriptions: no/expired/foreign token, two concurrent identities, rapid events, expiry mid-stream
- [ ] String args fuzzed for SQL/ORM/format-string/path/URL sinks
- [ ] Shared caches keyed on principal
- [ ] Persisted-query IDs: unknown ID rejected, not falling back to `query`
## Exploitation and escalation
- **Schema → hidden operation → ATO.** Introspection revealed `tokenForgotPasswords` returning live reset tokens: enumerate users, trigger reset, read token ([[raw/medium.com/mass-account-takeover-of-29-000-accounts-by-abusing-graphql-13886|Mass ATO]]). See [[GraphQL Introspection]].
- **Validation errors → reset mutation → alias brute force.** Overgrowth CTF: introspection off, errors named `resetPassword`; 10,000 codes in ~3.5 s → admin ([[raw/p4ndora.ai/overgrowth-graphql-aliased-mutation-brute-force-of-a-password-reset-hi-14207|Overgrowth]]). See [[GraphQL Batching Attacks]].
- **Identity from arguments.** `brassCheckAccess(username, role)` authorized whoever was named → swap in an admin ([[raw/praetorian.com/exploiting-broken-authentication-control-in-graphql-4765|Praetorian]]).
- **Payment as victim.** `/BFF/graphql/mutation/doPayment` accepted a victim UID; `receiptUrl` exposed PII ([[raw/salt.security/api-threat-research-graphql-authorization-flaws-in-a-fintech-platform-4768|Salt Labs]]).
- **Secret leak → forged admin.** Phoenix `applyChatTemplate` leaked `PHOENIX_SECRET` → forged admin JWTs and decrypted stored LLM keys ([[raw/corgea.com/arize-phoenix-cve-2026-53998-one-unauthenticated-graphql-query-reads-o-15484|Corgea]]); see [[JSON Web Tokens]].
- **SQLi → file read.** Hasura 1.3.3 SQLi reached `pg_read_file()` ([[raw/vulncheck.com/hasura-graphql-1-3-3-local-file-read-via-sql-injection-4392|VulnCheck]]); URL-fetching mutation chained to code execution in HTB Cereal ([[raw/pwnatlas.app/graphql-pentesting-introspection-queries-and-mutations-step-by-step-15483|PwnAtlas]]). See [[Remote Code Execution]].
- **CSRF → local RCE.** Cypress Launchpad's unauthenticated GraphQL server let a website set the "preferred editor" to an arbitrary command ([[raw/github.com/cypress-launchpad-graphql-server-exposed-to-cross-site-requests-allows-15487|GHSA-pgrh-36vg-cqj7]]).
- **CSRF → third-party data.** HackerOne Tray.io: CSRF linked victim integrations to the attacker, whose GraphQL access then reached private repos ([[raw/medmahmoudi.com/csrf-in-hackerone-tray-io-integration-12611|medmahmoudi]]).
- **Batching for availability.** Directus anonymous aliased `auth_login` (suspend any account), `auth_password_request` (mail flood), `utils_hash_generate` (argon2id CPU) ([[raw/github.com/directus-unthrottled-system-graphql-resolvers-allow-anonymous-dos-via-13550|Directus advisory]]).
## Bypassing defenses
| Defense | Why it fails | Page |
|---|---|---|
| Introspection disabled | Suggestions, error-shape oracles, regex gaps (`__schema\n`), GET/form transport, JS bundles. Fixture test: the unguarded `adminUserRecord(id)` still leaked with introspection off; only the resolver check stopped it | [[GraphQL Introspection]] |
| Request-count rate limit / lockout | Aliases and arrays execute N attempts per request; a 5-attempts/min lockout fell to 200 aliased `login` calls ([[raw/bipi.in/graphql-batching-abuse-and-how-to-stop-it-14646|bipi.in]]) | [[GraphQL Batching Attacks]], [[API Rate Limiting]] |
| Per-alias dedup fix | Directus fixed aliased `server_health` in `system.ts` but missed `system-global.ts` | [[GraphQL Batching Attacks]] |
| Per-operation complexity limit | Array batching multiplies in-limit operations with no array cap (Saleor GHSA-24jw-f244-qfpp) | [[GraphQL Batching Attacks]] |
| Global WebSocket size limits | Applied per upgrade handler; a missed handler falls back to library defaults (SurrealDB GHSA-p3c2-wh5f-jwqm) | [[GraphQL Denial of Service]] |
| Depth limit | Depth ≥5 rejected, yet 50 aliases of an in-limit query passed — depth is not cost | [[GraphQL Denial of Service]] |
| App-level query limits | Fragment expansion in the router/compiler runs before them (CVE-2025-32034, CVE-2025-31496) | [[GraphQL Denial of Service]] |
| Persisted-query allowlist | CVE-2026-22014: unknown `queryId` fell back to client `query` | [[GraphQL Denial of Service]] |
| Root-resolver authz | Traversal, `node`, aggregates, `prev`/`next` (Nautobot, Craft CMS, @neo4j/graphql CVE-2026-92684) | [[GraphQL Authorization Flaws]] |
| Authz directives / `authorized?` | Library bugs treat failures as success (graphql-ruby GHSL-2026-152), evaluate only the first JWT condition (CVE-2026-92683) | [[GraphQL Authorization Flaws]] |
| WebSocket gateway auth | SSE/multipart subscriptions routed around it (graphql-orm-router RTR-2) | [[GraphQL Subscription Security]] |
| `SameSite=Lax` | Top-level GET navigation carries the cookie; GET mutations execute | [[GraphQL CSRF]] |
| Error masking | Removes the signal, not the bug: boolean always-true still widened results | [[GraphQL Injection]] |
| Removing `node`/`nodes` | Shrinks surface; not authorization | [[GraphQL Authorization Flaws]] |
## Real-world cases
- **GitLab CVE-2026-19478** (CVSS 9.4, CWE-94) — unauthenticated code injection via a crafted directive on `/api/graphql`; exploited in the wild within days ([[raw/rescana.com/active-exploitation-alert-critical-gitlab-cve-2026-19478-code-injectio-11745|Rescana]], [[raw/thehackernews.com/gitlab-cve-2026-19478-comes-under-active-exploitation-within-days-of-d-11600|THN]]).
- **GitLab CVE-2026-19650** (CVSS 7.1, CWE-352) — mutations via GET in multiplex query handling ([[raw/ox.security/critical-and-high-severity-graphql-cves-in-gitlab-code-injection-and-c-11524|OX Security]]).
- **Arize Phoenix CVE-2026-53998** (CVSS 10.0) — unauthenticated `applyChatTemplate` f-string reads `os.environ` ([[raw/github.com/arize-phoenix-format-string-injection-in-applychattemplate-graphql-que-14497|advisory]]).
- **WPGraphQL CVE-2026-40762** — unauthenticated SQLi before 2.11.1 ([[raw/github.com/unauthenticated-sql-injection-in-wpgraphql-2-11-1-cve-2026-40762-12763|advisory]]).
- **HackerOne #435066** — stacked `pg_sleep` SQLi via a URL parameter on `/graphql` ([[raw/hackerone.com/hackerone-report-435066-sql-injection-in-graphql-endpoint-4394|H1 #435066]]).
- **@graphql-tools/utils CVE-2026-114604** — `__proto__` path segment in `@defer`/`@stream` merge pollutes `Object.prototype` ([[raw/miggo.io/cve-2026-114604-graphql-tools-prototype-pollution-15486|Miggo]]).
- **graphql-ruby GHSL-2026-152** — `UnauthorizedError` from `authorized?` rescued and treated as authorized ([[raw/securitylab.github.com/ghsl-2026-152-privilege-escalation-via-authorization-bypass-in-graphql-13196|GHSL]]).
- **@neo4j/graphql CVE-2026-92683 / CVE-2026-92684** — first-condition-only JWT filter; aggregates bypass `@authentication` ([[raw/github.com/neo4j-graphql-only-the-first-condition-of-a-multi-condition-authentica-14044|92683]], [[raw/github.com/neo4j-graphql-aggregation-queries-bypass-authentication-cve-2026-92684-14208|92684]]).
- **Craft CMS GHSA-xpg7-m6gm-4xfh** — anonymous `prev`/`next` hops into sections withheld from the public schema ([[raw/github.com/craft-cms-5-0-0-before-5-11-2-graphql-schema-scope-bypass-via-prev-nex-14043|advisory]]).
- **Nautobot GHSA-mfwj-pjgx-22v2** — `view_location` users read Device fields through traversal ([[raw/github.com/nautobot-object-view-permissions-bypass-via-graphql-traversal-13551|advisory]]).
- **Drupal graphql_core_schema CVE-2026-126725** — anyone able to view an account could change its password ([[raw/drupal.org/drupal-graphql-core-schema-critical-improper-authorization-password-ch-14351|SA-CONTRIB-2026-316]]).
- **Prime CMS CVE-2026-129941** — unauthenticated `createUser` with `isAuthenticated()` commented out ([[raw/critical.is/prime-cms-auth-bypass-via-createuser-graphql-mutation-cve-2026-129941-15322|critical.is]]).
- **Kong graphql-proxy-cache-advanced CVE-2026-92442** — cache key omits caller identity ([[raw/github.com/kong-graphql-proxy-cache-advanced-leaks-cached-responses-across-caller-14783|advisory]]).
- **Parse Server CVE-2025-53364** — schema served without session token or master key ([[raw/escape.tech/graphql-introspection-security-lessons-from-the-parse-server-vulnerabi-4621|Escape]]).
- **Snapchat `deleteStorySnaps` IDOR** — delete anyone's Spotlight content, $15,000 ([[raw/oxo.is/delete-anyone-s-snapchat-spotlight-content-remotely-15-000-idor-via-gr-13720|oxo.is]]).
- **Airline booking GraphQL BOLA** — predictable IDs, mass read/modify of passenger PII ([[raw/wiz.io/the-red-agent-pov-exploiting-broken-object-level-authorization-in-an-a-9944|Wiz]]).
- **HackerOne `verifyAccountRecoveryPhoneNumber` alias DoS** — $12,500 ([[raw/infosecwriteups.com/how-graphql-mutation-aliasing-led-to-a-12-500-dos-bug-in-hackerone-s-a-8836|InfoSec Write-ups]]).
- **Apollo Router CVE-2025-32034** — exponential named-fragment expansion in query planning ([[raw/github.com/apollo-router-query-planner-excessive-resource-consumption-via-named-f-4769|advisory]]).
- **@graphql-tools/executor-graphql-ws GHSA-364q-4p2h-gcf3** — later subscribers authenticated upstream as the first ([[raw/github.com/graphql-tools-executor-graphql-ws-cross-session-credential-reuse-lets-15633|advisory]]).
- **@neo4j/graphql < 7.5.6** — unverified `connectionParams.jwt` accepted on subscriptions ([[raw/github.com/neo4j-graphql-subscription-auth-bypass-via-unverified-connectionparams-13198|advisory]]).
- **Apollo Sandbox/Explorer CVE-2025-59845** — no `postMessage` origin check ([[raw/ameeba.com/cve-2025-59845-csrf-vulnerability-in-apollo-studio-embeddable-explorer-4760|Ameeba]]).
- **Mass ATO, 29,000 accounts** — introspected `tokenForgotPasswords` ([[raw/medium.com/mass-account-takeover-of-29-000-accounts-by-abusing-graphql-13886|Medium]]).
- **"City-Forum" campaign** — guest-user data theft via Salesforce LWR GraphQL/Aura endpoints ([[raw/bleepingcomputer.com/city-forum-data-theft-attacks-target-salesforce-servicenow-portals-11899|BleepingComputer]]).
- **Saleor GHSA-24jw-f244-qfpp** — unbounded JSON-array batching bypassed per-query complexity limits; fixed 3.23.0a3 / 3.22.47 / 3.21.54 / 3.20.118 ([[raw/github.com/saleor-dos-via-unbounded-graphql-query-batching-15819|advisory]]).
- **SurrealDB GHSA-p3c2-wh5f-jwqm** — GraphQL WebSocket upgrade ignored operator-configured frame/message/buffer limits; anonymous memory amplification; fixed in 4.0.0 ([[raw/github.com/surrealdb-graphql-websocket-missing-size-limits-memory-amplification-15822|advisory]]).
- **Voucher-code mutation (API4:2023)** — request-count limit of 10 bypassed by alias batching; 5,000 aliases produced 504 Gateway Timeouts on Azure Container Apps ([[raw/medium.com/graphql-alias-batching-bypasses-rate-limiting-15820|Medium]]).
- **PortSwigger rate-limited GraphQL login** — 100 aliased `login` mutations with `success` selected in one request; the limiter counted one request ([[raw/logicbreaker.sh/bypassing-graphql-brute-force-protections-15818|logicbreaker]]).
## Prevention
- **Authorization in the data/business layer** every resolver calls, so edges, `node`, aggregates and payloads inherit it; identity from verified context, never from arguments (Apollo: populate `contextValue` from the token; GraphOS `@authenticated` / `@requiresScopes`) ([[raw/apollographql.com/apollo-authentication-and-authorization-docs-4400|Apollo docs]]). Regression-test every directive combination; include the principal in cache keys.
- **Operation safelisting / persisted queries** — reject unknown IDs, never fall back to `query`. Removes runtime alias construction and unknown fields ([[raw/apollographql.com/enforcing-graphql-security-best-practices-with-graphos-4399|GraphOS]], [[raw/github.com/graphql-persisted-queries-allowlist-bypass-via-id-manipulation-14897|allowlist bypass]]).
- **Limits on shape and cost:** depth (`validationRules: [depthLimit(7)]`, graphql-java `MaxQueryDepthInstrumentation`), cost (`MaxQueryComplexityInstrumentation`), aliases/tokens/root fields (GraphQL Armor `max-aliases`, `max-tokens`; GraphOS operation limits), server-enforced pagination maxima, DataLoader for N+1, resolver-level timeouts plus infra timeouts ([[raw/cheatsheetseries.owasp.org/graphql-cheat-sheet-owasp-2815|OWASP]], [[raw/escape.tech/cyclic-queries-and-depth-limiting-escape-4402|Escape]]).
- **Rate-limit operations, not requests** — count aliases and array entries at the gateway, limit at the resolver keyed on resolver + principal; attempt counters on the secret itself; `allowBatchedHttpRequests: false` unless needed ([[raw/cheatsheetseries.owasp.org/graphql-cheat-sheet-owasp-2815|OWASP]], [[raw/bipi.in/graphql-batching-abuse-and-how-to-stop-it-14646|bipi.in]]). See [[API Rate Limiting]].
- **Cap the envelope, not just the operation:** maximum array length (or no arrays) and body size at the WAF were Saleor's interim fix; bind WebSocket frame/message/buffer limits on every upgrade handler through one shared helper ([[raw/github.com/saleor-dos-via-unbounded-graphql-query-batching-15819|Saleor]], [[raw/github.com/surrealdb-graphql-websocket-missing-size-limits-memory-amplification-15822|SurrealDB]]).
- **Schema exposure:** disable introspection on private APIs (Apollo `introspection: process.env.NODE_ENV !== 'production'`; graphql-core `NoSchemaIntrospectionCustomRule`), hide suggestions (`hideSchemaDetailsFromClientErrors`, `hide_suggestions`), mask errors — as hygiene, not as a control.
- **Transport:** JSON POST only with content-type validation; reject mutations over GET with 4xx; CSRF token or required custom header for cookie auth; validate `postMessage` origins; bind dev GraphQL servers to loopback with `Origin` checks.
- **Subscriptions:** verify signed tokens at `ConnectionInit`; same checks on every transport; authorize per event including each batch element; per-connection state only; tear down on expiry.
- **Injection:** parameterize; cast to primitives before ORM calls; allowlist-validate input types and custom scalars; use variables, not string concatenation, for downstream GraphQL; sandbox templates; validate keys on merges of untrusted payloads.
- **Patch the engine.** Router, compiler, validator, executor and authz-library bugs bypass app-level controls ([[raw/wundergraph.com/the-complete-graphql-security-guide-fixing-the-13-most-common-vulnerab-4185|WunderGraph]]).
## Tools
| Need | Tools |
|---|---|
| Burp integration | InQL (schema parsing, query generation, circular-reference detection, batch attacks, fingerprinting) ([[raw/github.com/inql-advanced-graphql-security-testing-burp-extension-4179|InQL]]); GQLParser ([[raw/github.com/br3akp0int-gqlparser-a-repository-for-graphql-extension-for-burp-suite-431|br3akp0int/GQLParser]]); BurpAPISecuritySuite ([[raw/github.com/teycir-burpapisecuritysuite-burp-suite-extension-for-api-security-test-5546|Teycir/BurpAPISecuritySuite]]) |
| Fingerprint / schema | graphw00f, Clairvoyance / clairvoyancex, graphql-path-enum, GraphQL Voyager, Altair; GraphCrawler (Graphinder discovery + Clairvoyance, 1–10 scoring) ([[raw/github.com/gsmith257-cyber-graphcrawler-graphql-automated-security-testing-toolki-425|GraphCrawler]]) |
| Misconfig / DoS baseline | graphql-cop ([[raw/redamon.org/graphql-security-testing-introspection-and-graphql-cop-15485|Redamon]]) |
| Batching | BatchQL ([[raw/github.com/batchql-graphql-security-auditing-for-batch-attacks-4178|BatchQL]]), CrackQL, InQL batch attack |
| Injection | GraphQLmap ([[raw/github.com/swisskyrepo-graphqlmap-graphqlmap-is-a-scripting-engine-to-interact-wi-430|GraphQLmap]]) |
| Schema-aware fuzzing / IDOR | GraphQLer dual-profile replay ([[raw/github.com/graphqler-context-aware-graphql-api-fuzzing-tool-4763|GraphQLer]]); Schemathesis GraphQL coverage phase ([[raw/github.com/schemathesis-4-33-0-graphql-coverage-phase-and-unary-grpc-fuzzing-14494|Schemathesis]]) |
| Practice | DVGA ([[raw/github.com/damn-vulnerable-graphql-application-5088|DVGA]]), PortSwigger GraphQL labs |
| Defense libraries | GraphQL Armor, `graphql-depth-limit`, graphql-java instrumentations, Apollo GraphOS limits and safelisting |
| Reading lists | Awesome GraphQL Security ([[raw/github.com/awesome-graphql-security-curated-list-of-resources-2741|list]]), PayloadsAllTheThings ([[raw/github.com/payloadsallthethings-graphql-injection-4617|PATT]]), disclosed-report roundup ([[raw/securehyperloop.com/graphql-bug-bounty-writeups-and-disclosed-reports-13200|SecureHyperloop]]), OWASP WSTG ([[raw/owasp.org/owasp-wstg-testing-graphql-4410|WSTG]]), pentest checklists ([[raw/invadel.com/graphql-security-testing-and-pentest-checklist-14352|Invadel]], [[raw/threatexploit.ai/graphql-api-testing-a-step-by-step-pentest-guide-15323|ThreatExploit]]), Doyensec overview ([[raw/blog.doyensec.com/graphql-security-overview-and-testing-tips-doyensec-s-blog-423|Doyensec]]) |
Related topics: [[API Security]], [[OWASP API Security Top 10]], [[BOLA in APIs]], [[Broken Access Control]], [[API Rate Limiting]], [[API Discovery]], [[API Fuzzing]], [[API Gateway Security]], [[SQL Injection]], [[Cross-Site Request Forgery]], [[Server-Side Request Forgery]], [[Authorization Testing Automation]], [[Bug Bounty Hunting]].
## Sub-pages
- [[GraphQL Introspection]] — `__schema`, suggestion and error-shape oracles, transport/regex bypasses; why disabling it isn't a control.
- [[GraphQL Authorization Flaws]] — path-not-object checks, `node(id)`, traversal, aggregates, directive and library bugs.
- [[GraphQL Subscription Security]] — `connectionParams` trust, cross-session credential reuse, SSE vs WebSocket parity, batched notifications.
- [[GraphQL Batching Attacks]] — aliases and array batching vs request-counting limiters: OTP/reset brute force, lockouts, mail floods.
- [[GraphQL Denial of Service]] — cyclic depth, fragment expansion, duplication, parser/planner/validator CVEs; depth vs cost limits.
- [[GraphQL Injection]] — SQL/ORM, format strings, directive code injection, downstream GraphQL, prototype pollution, SSRF.
- [[GraphQL CSRF]] — GET and form-encoded execution, `SameSite=Lax` + GET mutations, `postMessage` and loopback dev servers.
## Sources
- [[raw/cheatsheetseries.owasp.org/graphql-cheat-sheet-owasp-2815|GraphQL Cheat Sheet]]
- [[raw/dev.to/graphql-bola-one-object-many-paths-and-how-to-prove-the-gap-14345|GraphQL BOLA: one object, many paths, and how to prove the gap]]
- [[raw/konghq.com/top-graphql-security-vulnerabilities-analyzing-1-500-endpoints-3125|Top GraphQL Security Vulnerabilities: Analyzing 1,500+ Endpoints]]
- [[raw/dedsecops.com/confirming-graphql-dast-findings-introspection-batching-depth-cost-csr-14495|Confirming GraphQL DAST findings: introspection, batching, depth/cost, CSRF over GET]]
- [[raw/rapid7.com/cve-2021-4191-gitlab-graphql-api-user-enumeration-fixed-9502|CVE-2021-4191: GitLab GraphQL API User Enumeration (FIXED)]]
- [[raw/medium.com/mass-account-takeover-of-29-000-accounts-by-abusing-graphql-13886|Mass account takeover of 29,000 accounts by abusing GraphQL]]
- [[raw/thehackernews.com/gitlab-cve-2026-19478-comes-under-active-exploitation-within-days-of-d-11600|GitLab CVE-2026-19478 Comes Under Active Exploitation Within Days of Disclosure]]
- [[raw/bleepingcomputer.com/city-forum-data-theft-attacks-target-salesforce-servicenow-portals-11899|"City-Forum" data-theft attacks target Salesforce ServiceNow portals]]
- [[raw/portswigger.net/graphql-api-vulnerabilities-web-security-academy-2745|GraphQL API Vulnerabilities]]
- [[raw/excessionlabs.ai/graphql-introspection-disabling-it-leaves-the-field-open-14206|GraphQL introspection: disabling it leaves the field open]]
- [[raw/bipi.in/graphql-batching-abuse-and-how-to-stop-it-14646|GraphQL batching abuse and how to stop it]]
- [[raw/escape.tech/avoid-graphql-denial-of-service-attacks-through-batching-and-aliasing-4767|Avoid GraphQL Denial-of-Service Attacks through Batching and Aliasing]]
- [[raw/guide.sonatype.com/graphql-hive-gateway-batch-execute-authorization-bypass-13388|GraphQL Hive Gateway batch-execute authorization bypass]]
- [[raw/escape.tech/cyclic-queries-and-depth-limiting-escape-4402|Cyclic Queries and Depth Limiting (Escape)]]
- [[raw/fdzdev.medium.com/exploiting-csrf-in-graphql-applications-4180|Exploiting CSRF in GraphQL Applications]]
- [[raw/book.hacktricks.wiki/graphql-hacktricks-5084|GraphQL - HackTricks]]
- [[raw/blog.assetnote.io/exploiting-graphql-435|Exploiting GraphQL]]
- [[raw/redamon.org/graphql-security-testing-introspection-and-graphql-cop-15485|GraphQL Security Testing: Introspection and graphql-cop]]
- [[raw/p4ndora.ai/overgrowth-graphql-aliased-mutation-brute-force-of-a-password-reset-hi-14207|Overgrowth: GraphQL aliased-mutation brute force of a password reset (HI CyberCon 2026)]]
- [[raw/praetorian.com/exploiting-broken-authentication-control-in-graphql-4765|Exploiting Broken Authentication Control in GraphQL]]
- [[raw/salt.security/api-threat-research-graphql-authorization-flaws-in-a-fintech-platform-4768|API Threat Research: GraphQL Authorization Flaws in a FinTech Platform]]
- [[raw/corgea.com/arize-phoenix-cve-2026-53998-one-unauthenticated-graphql-query-reads-o-15484|Arize Phoenix CVE-2026-53998: one unauthenticated GraphQL query reads os.environ via f-string]]
- [[raw/vulncheck.com/hasura-graphql-1-3-3-local-file-read-via-sql-injection-4392|Hasura GraphQL 1.3.3 Local File Read via SQL Injection]]
- [[raw/pwnatlas.app/graphql-pentesting-introspection-queries-and-mutations-step-by-step-15483|GraphQL pentesting: introspection, queries and mutations step by step]]
- [[raw/github.com/cypress-launchpad-graphql-server-exposed-to-cross-site-requests-allows-15487|Cypress Launchpad GraphQL server exposed to cross-site requests allows command execution]]
- [[raw/medmahmoudi.com/csrf-in-hackerone-tray-io-integration-12611|CSRF in HackerOne Tray.io integration]]
- [[raw/github.com/directus-unthrottled-system-graphql-resolvers-allow-anonymous-dos-via-13550|Directus unthrottled system GraphQL resolvers allow anonymous DoS via alias amplification]]
- [[raw/rescana.com/active-exploitation-alert-critical-gitlab-cve-2026-19478-code-injectio-11745|Active Exploitation Alert: Critical GitLab CVE-2026-19478 Code Injection Vulnerability]]
- [[raw/ox.security/critical-and-high-severity-graphql-cves-in-gitlab-code-injection-and-c-11524|Critical and High-Severity GraphQL CVEs in GitLab: Code Injection and CSRF via One Directive]]
- [[raw/github.com/arize-phoenix-format-string-injection-in-applychattemplate-graphql-que-14497|Arize Phoenix: format string injection in applyChatTemplate GraphQL query leaks secrets]]
- [[raw/github.com/unauthenticated-sql-injection-in-wpgraphql-2-11-1-cve-2026-40762-12763|Unauthenticated SQL injection in WPGraphQL 2.11.1 (CVE-2026-40762)]]
- [[raw/hackerone.com/hackerone-report-435066-sql-injection-in-graphql-endpoint-4394|HackerOne Report #435066: SQL injection in GraphQL endpoint]]
- [[raw/miggo.io/cve-2026-114604-graphql-tools-prototype-pollution-15486|CVE-2026-114604: GraphQL Tools prototype pollution]]
- [[raw/securitylab.github.com/ghsl-2026-152-privilege-escalation-via-authorization-bypass-in-graphql-13196|GHSL-2026-152: privilege escalation via authorization bypass in graphql-ruby]]
- [[raw/github.com/neo4j-graphql-only-the-first-condition-of-a-multi-condition-authentica-14044|@neo4j/graphql: only the first condition of a multi-condition @authentication JWT filter is evaluated]]
- [[raw/github.com/neo4j-graphql-aggregation-queries-bypass-authentication-cve-2026-92684-14208|@neo4j/graphql aggregation queries bypass @authentication (CVE-2026-92684)]]
- [[raw/github.com/craft-cms-5-0-0-before-5-11-2-graphql-schema-scope-bypass-via-prev-nex-14043|Craft CMS 5.0.0 before 5.11.2 GraphQL schema scope bypass via prev/next (critical)]]
- [[raw/github.com/nautobot-object-view-permissions-bypass-via-graphql-traversal-13551|Nautobot object view permissions bypass via GraphQL traversal]]
- [[raw/drupal.org/drupal-graphql-core-schema-critical-improper-authorization-password-ch-14351|Drupal GraphQL Core Schema critical improper authorization: password change account takeover]]
- [[raw/critical.is/prime-cms-auth-bypass-via-createuser-graphql-mutation-cve-2026-129941-15322|Prime CMS auth bypass via createUser GraphQL mutation (CVE-2026-129941)]]
- [[raw/github.com/kong-graphql-proxy-cache-advanced-leaks-cached-responses-across-caller-14783|Kong graphql-proxy-cache-advanced leaks cached responses across callers]]
- [[raw/escape.tech/graphql-introspection-security-lessons-from-the-parse-server-vulnerabi-4621|GraphQL Introspection Security: Lessons from the Parse Server Vulnerability]]
- [[raw/oxo.is/delete-anyone-s-snapchat-spotlight-content-remotely-15-000-idor-via-gr-13720|Delete anyone's Snapchat Spotlight content remotely ($15,000 IDOR via GraphQL mutation)]]
- [[raw/wiz.io/the-red-agent-pov-exploiting-broken-object-level-authorization-in-an-a-9944|The Red Agent POV: Exploiting Broken Object-Level Authorization in an Airline GraphQL API]]
- [[raw/infosecwriteups.com/how-graphql-mutation-aliasing-led-to-a-12-500-dos-bug-in-hackerone-s-a-8836|How GraphQL Mutation Aliasing Led to a $12,500 DoS Bug in HackerOne’s Account Recovery]]
- [[raw/github.com/apollo-router-query-planner-excessive-resource-consumption-via-named-f-4769|Apollo Router Query Planner Excessive Resource Consumption via Named Fragment Expansion]]
- [[raw/github.com/graphql-tools-executor-graphql-ws-cross-session-credential-reuse-lets-15633|graphql-tools executor-graphql-ws: cross-session credential reuse lets users subscribe as another user]]
- [[raw/github.com/neo4j-graphql-subscription-auth-bypass-via-unverified-connectionparams-13198|@neo4j/graphql subscription auth bypass via unverified connectionParams.jwt]]
- [[raw/ameeba.com/cve-2025-59845-csrf-vulnerability-in-apollo-studio-embeddable-explorer-4760|CVE-2025-59845: CSRF Vulnerability in Apollo Studio Embeddable Explorer and Sandbox]]
- [[raw/apollographql.com/apollo-authentication-and-authorization-docs-4400|Apollo Authentication and Authorization Docs]]
- [[raw/apollographql.com/enforcing-graphql-security-best-practices-with-graphos-4399|Enforcing GraphQL security best practices with GraphOS]]
- [[raw/github.com/graphql-persisted-queries-allowlist-bypass-via-id-manipulation-14897|GraphQL persisted queries allowlist bypass via ID manipulation]]
- [[raw/wundergraph.com/the-complete-graphql-security-guide-fixing-the-13-most-common-vulnerab-4185|The Complete GraphQL Security Guide: Fixing the 13 Most Common Vulnerabilities]]
- [[raw/github.com/inql-advanced-graphql-security-testing-burp-extension-4179|InQL: Advanced GraphQL Security Testing Burp Extension]]
- [[raw/github.com/br3akp0int-gqlparser-a-repository-for-graphql-extension-for-burp-suite-431|br3akp0int/GQLParser]]
- [[raw/github.com/teycir-burpapisecuritysuite-burp-suite-extension-for-api-security-test-5546|Teycir/BurpAPISecuritySuite]]
- [[raw/github.com/gsmith257-cyber-graphcrawler-graphql-automated-security-testing-toolki-425|gsmith257-cyber/GraphCrawler: GraphQL automated security testing toolkit]]
- [[raw/github.com/batchql-graphql-security-auditing-for-batch-attacks-4178|BatchQL: GraphQL Security Auditing for Batch Attacks]]
- [[raw/github.com/swisskyrepo-graphqlmap-graphqlmap-is-a-scripting-engine-to-interact-wi-430|swisskyrepo/GraphQLmap]]
- [[raw/github.com/graphqler-context-aware-graphql-api-fuzzing-tool-4763|GraphQLer: Context-Aware GraphQL API Fuzzing Tool]]
- [[raw/github.com/schemathesis-4-33-0-graphql-coverage-phase-and-unary-grpc-fuzzing-14494|Schemathesis 4.33.0: GraphQL coverage phase and unary gRPC fuzzing]]
- [[raw/github.com/damn-vulnerable-graphql-application-5088|Damn Vulnerable GraphQL Application]]
- [[raw/github.com/awesome-graphql-security-curated-list-of-resources-2741|Awesome GraphQL Security - Curated List of Resources]]
- [[raw/github.com/payloadsallthethings-graphql-injection-4617|PayloadsAllTheThings — GraphQL Injection]]
- [[raw/securehyperloop.com/graphql-bug-bounty-writeups-and-disclosed-reports-13200|GraphQL bug bounty writeups and disclosed reports]]
- [[raw/owasp.org/owasp-wstg-testing-graphql-4410|OWASP WSTG: Testing GraphQL]]
- [[raw/invadel.com/graphql-security-testing-and-pentest-checklist-14352|GraphQL security testing and pentest checklist]]
- [[raw/threatexploit.ai/graphql-api-testing-a-step-by-step-pentest-guide-15323|GraphQL API Testing: A Step-by-Step Pentest Guide]]
- [[raw/blog.doyensec.com/graphql-security-overview-and-testing-tips-doyensec-s-blog-423|GraphQL - Security Overview and Testing Tips · Doyensec's Blog]]
- [[raw/blog.arok.win/graphql-field-suggestion-abuse-rebuilding-a-hidden-schema-15821|GraphQL field suggestion abuse: rebuilding a hidden schema]]
- [[raw/github.com/saleor-dos-via-unbounded-graphql-query-batching-15819|Saleor: DoS via unbounded GraphQL query batching]]
- [[raw/github.com/surrealdb-graphql-websocket-missing-size-limits-memory-amplification-15822|SurrealDB GraphQL WebSocket missing size limits (memory amplification)]]
- [[raw/logicbreaker.sh/bypassing-graphql-brute-force-protections-15818|Bypassing GraphQL brute force protections]]
- [[raw/medium.com/graphql-alias-batching-bypasses-rate-limiting-15820|GraphQL Alias Batching Bypasses Rate Limiting]]