performing-graphql-depth-limit-attack

Tests GraphQL endpoints for depth limit vulnerabilities using nested, circular, and batched queries.

4|Updated Apr 28, 2026
One-click install
npx skills add https://github.com/braydos-h/BreachPilot --skill performing-graphql-depth-limit-attack-braydos-h
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: performing-graphql-depth-limit-attack
Source: https://github.com/braydos-h/BreachPilot/tree/main/skills/performing-graphql-depth-limit-attack
Command: npx skills add https://github.com/braydos-h/BreachPilot --skill performing-graphql-depth-limit-attack-braydos-h

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, and includes scripts (resource) and references (resource) components.

What problem does it solve? GraphQL APIs with circular schema relationships can be abused through deeply nested or amplified queries that exhaust server CPU, memory, and database connections, causing denial of service. This Skill helps authorized security testers determine whether a GraphQL endpoint enforces depth limits, complexity analysis, and batch restrictions before attackers find the gap. ## Core Features & Use Cases - Depth Limit Probing: Sends progressively deeper nested queries (up to a configurable maximum) and reports the exact depth at which the server blocks requests, with severity classification. - Multiple Attack Vectors: Tests recursive depth attacks, alias-based amplification, fragment spread attacks, field duplication, circular reference queries, and batch query bypasses. - Resource Exhaustion Detection: Measures response latency on wide-plus-deep queries to flag slow responses indicating resource exhaustion risk. - Use Case: During an authorized API security assessment, run the depth test against a staging GraphQL endpoint to confirm whether the server rejects queries deeper than the intended limit, then document findings with severity ratings for the remediation report. ## Quick Start Ask the agent to run the depth limit test against your authorized GraphQL endpoint, for example by requesting a depth probe of https://your-staging-api.example.com/graphql with a maximum depth of 20.

Frequently Asked Questions about performing-graphql-depth-limit-attack

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test a GraphQL API for depth limit vulnerabilities?▼

Send progressively deeper nested queries against the endpoint and observe where requests get blocked. The included agent.py script automates this with the depth subcommand, reporting the maximum allowed depth and a severity rating based on how deep queries succeed.

What is a GraphQL depth limit attack?▼

A depth limit attack exploits circular schema relationships, such as User to Posts to Author, to craft recursively nested queries that consume excessive server resources. Without depth limiting, these queries can cause denial of service through CPU, memory, and database exhaustion.

Can batch queries bypass GraphQL depth limits?▼

Yes, some servers enforce depth limits per query but accept batched arrays of queries in a single HTTP request, multiplying the load. The batch subcommand tests whether an endpoint accepts arrays of queries and flags this as a finding.

What tools are needed to run GraphQL depth testing?▼

You need Python 3.8 or later with the requests library installed, plus network access to the target endpoint. Optional tools like Burp Suite or mitmproxy help with traffic analysis, and authorization from the target owner is mandatory.

How do I mitigate GraphQL depth limit attacks?▼

Enforce query depth limits with libraries like graphql-depth-limit, add query complexity analysis with graphql-query-complexity, and apply rate limiting, query timeouts, alias caps, and batch size restrictions on the server.

Is it legal to run depth limit attacks against any GraphQL API?▼

No, testing is only legal on systems you own or have explicit written permission to assess. Unauthorized depth attacks constitute denial-of-service activity and may violate computer fraud laws.