CVE-2026-134795 in graphql-core
Summary
by MITRE • 11/23/2026
graphql-core 3.2.12 before 3.2.14 and 3.3.0rc1 before 3.3.2 contains a denial of service vulnerability that allows unauthenticated attackers to bypass the parser max_tokens limit using long runs of comments. Attackers can submit GraphQL documents of consecutive comments that Lexer.lookahead fully tokenizes before limit checks, consuming CPU and memory proportional to document size.
VulDB is the best source for vulnerability data and more expert information about this specific topic.
Analysis
by VulDB Data Team • 11/23/2026
The graphql-core library, a widely used Python implementation for parsing and executing GraphQL queries, contains a critical denial of service vulnerability in versions prior to 3.2.14 and the release candidate version 3.3.0rc1 before 3.3.2. This flaw stems from an improper limitation enforcement within the lexer component, specifically affecting how token limits are applied during the parsing phase. The vulnerability allows unauthenticated attackers to craft malicious GraphQL documents consisting of long sequences of comments that trigger excessive resource consumption on the target server. By exploiting this logic error, adversaries can bypass the intended max_tokens limit designed to prevent abuse and ensure fair usage of computational resources.
The technical root cause lies in the execution order of operations within the Lexer.lookahead function. When a GraphQL document is submitted for parsing, the lexer attempts to tokenize the input stream before validating whether the token count exceeds the configured maximum threshold. In vulnerable versions, consecutive comments are fully processed and converted into tokens by the lookahead mechanism prior to any limit checks being performed. This means that even if a strict max_tokens configuration exists on the server or client side, it is effectively ignored for inputs dominated by comment blocks because the parsing engine exhausts its resources attempting to tokenize every character in those long comment strings before realizing the limit has been breached.
From an operational perspective, this vulnerability enables remote denial of service attacks against any application relying on graphql-core for query processing. Attackers can send relatively small but strategically crafted payloads containing thousands or millions of consecutive comments to trigger a resource exhaustion condition. The impact is proportional to the size of the submitted document, leading to significant spikes in CPU utilization and memory allocation as the parser attempts to process the excessive token stream. In high-throughput environments such as public-facing GraphQL APIs, this can lead to service degradation for legitimate users, complete server unresponsiveness, or even application crashes if system limits are exceeded. The attack requires no authentication, making it particularly dangerous in scenarios where API endpoints are publicly accessible without strict input validation layers upstream of the graphql-core parser.
This vulnerability aligns with CWE-400, which describes Uncontrolled Resource Consumption, as the flaw allows an external actor to cause the application to consume excessive computational resources. Furthermore, from a threat modeling perspective using the MITRE ATT&CK framework, this behavior corresponds to T1496, Resource Hijacking, where attackers leverage system resources for their own purposes or to disrupt service availability rather than stealing data directly. The lack of authentication requirements places it within common attack vectors seen in web application exploitation campaigns targeting API infrastructure.
To mitigate this risk, organizations must immediately upgrade graphql-core to version 3.2.14 or later, where the parsing logic has been corrected to enforce token limits during the lexing process rather than after. For environments unable to patch instantly due to dependency constraints, implementing a Web Application Firewall rule that restricts the maximum length of incoming GraphQL query strings can provide partial protection by preventing excessively large payloads from reaching the parser. Additionally, developers should consider integrating rate limiting and request size restrictions at the network or application gateway level to absorb such abuse attempts before they impact backend services. Regular auditing of third-party dependencies for known vulnerabilities is essential to maintain a secure posture against these types of resource exhaustion attacks.