CVE-2026-75508
Memory exhaustion via comment‑padded GraphQL documents bypassing token limit.
- CVSS 7.5
- CWE-400
- Resource Management
- Remote
GraphQL-core is a Python port of the GraphQL.js reference implementation. From 3.2.3 until 3.2.12 and 3.3.0rc1, the parser's max_tokens limit in Parser.advance_lexer counts only non-comment tokens returned after Lexer.lookahead skips comments. Each skipped comment is still allocated as a Token and retained through token.next and token.prev, allowing a highly compressible comment-padded GraphQL document to pass a low token limit while consuming memory. An unauthenticated remote attacker can exhaust worker memory before AST-based depth or complexity controls run. This issue is fixed in versions 3.2.12 and 3.3.0rc1.
- CWE
- CWE-400
- CVSS base score
- 7.5
- Published
- 2026-10-22
- OWASP
- A04 Insecure Design
- Orthogonal defect classification
- Timing/Serialization
- Code defect classification
- Missing Check
- 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‑core (graphene‑graphql) to ≥ 3.2.12 or ≥ 3.3.0rc1.
Vulnerable code sample
from graphql import parse, Source
from graphql.language.parser import Parser
def build_schema_from_query(raw_query: str):
# VULNERABLE: low max_tokens limit ignored for comment tokens, enabling memory exhaustion
source = Source(raw_query)
parser = Parser(source, max_tokens=500) # only non‑comment tokens counted
return parser.parse()Patched code sample
from graphql import parse, Source
from graphql.language.parser import Parser
def build_schema_from_query(raw_query: str):
# FIX: enforce max_tokens on all tokens, including comments
source = Source(raw_query)
parser = Parser(source, max_tokens=500, ignore_comments=False)
return parser.parse()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: count comment tokens toward the parser max_tokens limit (graphql-python/graphql-core)
src/graphql/language/parser.py · Parser.advance_lexer - fix: count comment tokens toward the parser max_tokens limit (graphql-python/graphql-core)
src/graphql/language/parser.py · Parser.advance_lexer
Cite this entry
@misc{vaitp:cve202675508,
title = {{Memory exhaustion via comment‑padded GraphQL documents bypassing token limit.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-75508},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-75508/}}
}
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 ::
