GraphQL Batching Attacks
Packing many operations into one HTTP request — via aliases, JSON-array batching or both — so that request-counting rate limits, lockouts and WAFs see one event while resolvers execute hundreds or thousands.
How it works
Three packaging forms, combinable:
# 1. Alias batching (spec feature; works on any server)
mutation {
a1: login(email:"u@x.com", password:"p1") { token }
a2: login(email:"u@x.com", password:"p2") { token }
# ... a1000
}// 2. JSON-array (HTTP) batching: server executes each element independently
[{"query":"mutation{login(...){token}}"},{"query":"..."}]- Query-name batching — multiple named operations in one document (BatchQL detects this separately from array batching).
- Mixed — 10 array entries × 100 aliases = 1,000 logical operations per HTTP request.
Which form works is target-specific: a voucher endpoint absorbed 50 array entries without effect but failed with 504s at 5,000 aliases, so test both rather than inferring one from the other (alias vs array). Selecting a boolean such as success on every alias turns the single response into the complete result set (logicbreaker).
The control failure is always the same: the limiter keys on HTTP requests (Cloudflare/NGINX at 60 req/min/IP) while cost is incurred per resolver invocation. One lab measured the amplification directly against a 1,000-entry password list, with the hit at position 738, all inside a single request.
Impact patterns
| Target | Effect |
|---|---|
login / password spray | Lockout counted per request, not per attempt |
| OTP / 2FA / reset code check | Whole 4–6 digit space in one or a few requests |
| Coupon / discount / invite code validators | Enumeration (isValidDiscount aliases in PortSwigger’s lab) |
| Expensive or side-effecting mutations | Mail/SMS flooding, CPU exhaustion, deliberate lockout of victims — see GraphQL Denial of Service |
| Object lookups by ID | Server-side enumeration and GraphQL Authorization Flaws at scale |
Notable cases
- HackerOne account recovery, $12,500 —
verifyAccountRecoveryPhoneNumberexecuted many times per request via aliases, degrading recovery for legitimate users; fix recommendation was hard caps on mutation aliases and per-request quotas for expensive operations. - Directus GHSA-g293-vf99-xv36 — an earlier fix (GHSA-6q22-g298-grjh) deduplicated aliased
server_healthinresolvers/system.tsbut missedresolvers/system-global.ts. AnonymousPOST /graphql/systemwith aliasedauth_login(suspend any account),auth_password_request(mail flood),utils_hash_generate(argon2id CPU burn) andutils_hash_verify(credential probing). - Property marketplace OTP sign-in — aliased
checkCodeguesses inside one request, compounded by a send-code call that honored a client-supplied code length (attacker shrinks the keyspace first). - Fintech login — 200 aliased
loginmutations bypassed a 5-attempts/minute lockout that incremented per HTTP request. - Overgrowth CTF — unauthenticated
requestPasswordReset+ uncountedresetPassword; all 10,000 codes in ~3.5 s, admin takeover. - GraphQL Hive Gateway batch-execute (sonatype-2026-010434, CVSS 4.0 8.6) — authorization bypass via context confusion between batched requests: batching as an authz problem, not only a rate-limit one.
- Saleor GHSA-24jw-f244-qfpp — JSON-array batching had no upper bound on operations, so per-query complexity limits were multiplied away; unauthenticated CPU, DB-connection and worker exhaustion. Interim WAF fix: cap body size or array length, or block arrays (advisory).
- Voucher-code check (OWASP API4:2023) — request-level limit of 10 bypassed with aliases; 5,000 alias nodes gave
INTERNAL_SERVER_ERRORand 504s consistent with node timeouts; on auto-scaling infrastructure this is also a denial-of-wallet vector (Medium). - PortSwigger brute-force lab — 100 aliased
login(input:{username, password})calls in onemutation {}(variables andoperationNameremoved); search the response for"success": true(logicbreaker). verifyOTPunder a 10 req/min/key limit — with a per-HTTP-request limit, a 10-operation array tests 10 codes per slot. For reports, a 5–10 operation batch plus the matching response is enough evidence; the remediation is per-operation limits as well as per-request ones (securityelites).- Zimbra NE GraphQL authentication (CVE-2026-93637) did not increment the SOAP IP lockout counter, allowing unthrottled credential guessing (Metasploit
zimbra_graphql_brute). (source)
Testing
- Take any rate-limited operation; resend as 10, 100, 1,000 aliases and as an array; compare per-alias results and whether the limiter or lockout fires.
- Probe support quickly with BatchQL or graphql-cop; automate with InQL’s batch attack, CrackQL (password/fuzz brute force) or Burp Intruder with one payload position per alias.
- Check whether the client can influence the target keyspace (code length, expiry, attempt counters).
- Report with raw request/response showing N attempts executed in one request; the alias feature alone is not a finding.
Defenses
- Count operations, not requests: parse at the gateway, count aliases and array entries, rate-limit at the resolver keyed on resolver + principal (OWASP: rate limits belong in the business-logic layer).
- Cap aliases and tokens (GraphQL Armor
max-aliases,max-tokens; Apollo GraphOS alias and root-field limits); reject over-limit with 400. - Disable HTTP array batching unless needed (Apollo Server
allowBatchedHttpRequests: false). - Bound array length explicitly when batching stays on; a per-operation complexity limit is not a per-request limit (Saleor).
- Prevent batching for sensitive objects (credentials, OTPs, tokens) and enforce attempt counters on the secret itself.
- Persisted/safelisted operations remove runtime alias construction entirely.
Related
- GraphQL Security
- GraphQL Denial of Service
- GraphQL Introspection
- API Rate Limiting
- Authentication Security
- Account Takeover
Sources
- Avoid GraphQL Denial-of-Service Attacks through Batching and Aliasing · original
- GraphQL API Vulnerabilities · original
- Exploiting GraphQL · original
- BatchQL: GraphQL Security Auditing for Batch Attacks · original
- GraphQL batching abuse and how to stop it · original
- GraphQL rate-limit bypass via batching · original
- Overgrowth: GraphQL aliased-mutation brute force of a password reset (HI CyberCon 2026) · original
- How GraphQL Mutation Aliasing Led to a $12,500 DoS Bug in HackerOne’s Account Recovery · original
- DoS via Mutation Aliasing in GraphQL — HackerOne Disclosure · original
- Directus unthrottled system GraphQL resolvers allow anonymous DoS via alias amplification · original
- GraphQL Hive Gateway batch-execute authorization bypass · original
- GraphQL Cheat Sheet · original
- Didn't Notice Your Rate Limiting: GraphQL Batching Attack · original
- Confirming GraphQL DAST findings: introspection, batching, depth/cost, CSRF over GET · original
- GraphQL batching and aliasing attacks: rate-limit bypass, brute force, DoS · original
- Saleor: DoS via unbounded GraphQL query batching · original
- Bypassing GraphQL brute force protections · original
- GraphQL Alias Batching Bypasses Rate Limiting · original
- GraphQL Vulnerabilities Bug Bounty 2026: Introspection, Batching and BOLA · original
- Metasploit Wrap Up: Breaking Zimbra's Identity Boundaries · original