Introspection-based circular query

firetail:graphql-circular-introspection

Type:

Observation

Rule Severity:

High

The GraphQL endpoint permits circular queries through introspection.

This allows users to recursively query the schema in a way that can cause excessive processing and resource consumption. This behavior increases the risk of denial-of-service (DoS) attacks by exploiting the server's ability to process introspective and recursive requests indefinitely.

Remediation

Update the GraphQL API to prevent circular queries enabled by introspection. Implement query depth and complexity limitations and consider disabling introspection in production environments where it is not needed.

Example Attack Scenario

An attacker sends an introspection query designed to recursively navigate through the GraphQL schema, causing the server to process an ever-growing set of requests. This creates a loop of excessive processing, potentially exhausting server resources and leading to a denial-of-service (DoS) attack. The attacker could exploit the introspection feature to continuously query relationships between types, causing the server to become overwhelmed and slow down.

How to Identify with Example Scenario

How to Resolve with Example Scenario

How to Identify with Example Scenario

Find the text in bold to identify issues such as these in API specifications

How to Resolve with Example Scenario

Modify the text in bold to resolve issues such as these in API specifications
References:

More findings

All Findings