VAITP Dataset

← Back to the dataset

CVE-2026-75507

Quadratic CPU DoS via nested inline fragments in GraphQL-core validation.

  • CVSS 7.5
  • CWE-400
  • Resource Management
  • Remote

GraphQL-core is a Python port of the GraphQL.js reference implementation. From 3.0.0 until 3.2.12 and 3.3.0rc1, the OverlappingFieldsCanBeMerged rule in specified_rules repeatedly compares fields that share response names and recursively re-compares flattened inline fragments during the validation phase. The prior named-fragment memoization does not cover this path, so nested repeated inline fragments can drive quadratic and worst-case O(n²·m²) CPU work before any resolver or AST-based depth or complexity control runs. An unauthenticated remote attacker can submit a shallow, highly compressible GraphQL query that pins a worker process and can saturate a multi-worker service. This issue is fixed in versions 3.2.12 and 3.3.0rc1.

CVSS base score
7.5
Published
2026-10-22
OWASP
A06 Vulnerable and Outdated Components
Orthogonal defect classification
Timing/Serialization
Code defect classification
Timing Issues
Category
Resource Management
Subcategory
Resource Exhaustion
Accessibility scope
Remote
Impact
Denial of Service (DoS)
Affected component
GraphQL-core
Fixed by upgrading
Yes

Solution

Upgrade graphene‑graphql‑core to version 3.2.12 or later (≥ 3.3.0rc1).

Vulnerable code sample

from graphql import GraphQLSchema, GraphQLObjectType, GraphQLField, GraphQLString, parse, validate, specified_rules

# Minimal schema
Query = GraphQLObjectType(
    name="Query",
    fields={"hello": GraphQLField(GraphQLString)}
)
schema = GraphQLSchema(query=Query)

def run_query(query_str: str):
    doc = parse(query_str)
    # VULNERABLE: uses OverlappingFieldsCanBeMerged without memoization, enabling O(n²) work
    errors = validate(schema, doc, rules=specified_rules)
    return errors

Patched code sample

from graphql import GraphQLSchema, GraphQLObjectType, GraphQLField, GraphQLString, parse, validate, specified_rules, OverlappingFieldsCanBeMerged

# Minimal schema
Query = GraphQLObjectType(
    name="Query",
    fields={"hello": GraphQLField(GraphQLString)}
)
schema = GraphQLSchema(query=Query)

class PatchedOverlappingFieldsCanBeMerged(OverlappingFieldsCanBeMerged):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self._processed_fragments = set()

    def _collect_fields(self, *args, **kwargs):
        # FIX: memoize processed inline fragments to avoid quadratic re‑comparison
        fragment = args[0] if args else None
        if fragment is not None and fragment in self._processed_fragments:
            return {}
        if fragment is not None:
            self._processed_fragments.add(fragment)
        return super()._collect_fields(*args, **kwargs)

def run_query(query_str: str):
    doc = parse(query_str)
    # Replace the vulnerable rule with the patched version
    custom_rules = [r for r in specified_rules if r is not OverlappingFieldsCanBeMerged] + [PatchedOverlappingFieldsCanBeMerged]
    errors = validate(schema, doc, rules=custom_rules)
    return errors

Published fix

Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.

  • fix: bound OverlappingFieldsCanBeMerged validation to prevent quadratic DoS (graphql-python/graphql-core)
    src/graphql/validation/rules/overlapping_fields_can_be_merged.py, src/graphql/validation/rules/overlapping_fields_can_be_merged.py · find_conflict, src/graphql/validation/rules/overlapping_fields_can_be_merged.py · OrderedPairSet.__init__, src/graphql/validation/rules/overlapping_fields_can_be_merged.py · OverlappingFieldsCanBeMergedRule.enter_selection_set, src/graphql/validation/rules/overlapping_fields_can_be_merged.py · OverlappingFieldsCanBeMergedRule.__init__
  • fix: bound OverlappingFieldsCanBeMerged validation to prevent quadratic DoS (graphql-python/graphql-core)
    src/graphql/validation/rules/overlapping_fields_can_be_merged.py, src/graphql/validation/rules/overlapping_fields_can_be_merged.py · find_conflict, src/graphql/validation/rules/overlapping_fields_can_be_merged.py · OverlappingFieldsCanBeMergedRule.enter_selection_set, src/graphql/validation/rules/overlapping_fields_can_be_merged.py · OverlappingFieldsCanBeMergedRule.__init__

Cite this entry

@misc{vaitp:cve202675507,
  title        = {{Quadratic CPU DoS via nested inline fragments in GraphQL-core validation.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-75507},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-75507/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.