Uncontrolled Recursion Affecting strawberry-graphql package, versions [0.71.0,0.315.7)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.3% (22nd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Uncontrolled Recursion vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-STRAWBERRYGRAPHQL-17173220
  • published5 Jun 2026
  • disclosed4 Jun 2026
  • creditgonas0919

Introduced: 4 Jun 2026

CVE-2026-47706  (opens in a new tab)
CWE-674  (opens in a new tab)

How to fix?

Upgrade strawberry-graphql to version 0.315.7 or higher.

Overview

strawberry-graphql is an A library for creating GraphQL APIs

Affected versions of this package are vulnerable to Uncontrolled Recursion in the determine_depth function when processing GraphQL queries containing circular fragment references. An attacker can exhaust server CPU resources and cause the validation process to crash by submitting specially crafted queries with recursive fragment spreads.

PoC

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")

CVSS Base Scores

version 4.0
version 3.1