HIGHCVSS v3.1 7.5Vulnerability

CVE-2026-75508

### Summary The parser's `max_tokens` limit — the documented defence against oversized GraphQL documents — did not count comment tokens. A document padded with comments could therefore pass a `max_tokens` check of any size while still allocating one `Token` object per comment, all of which stay reachable for the lifetime of the parsed document. A 38 MB comment-padded payload allocated roughly 92 MB of additional resident memory with `max_tokens=5` in force. ### Details `Lexer.lookahead()` reads tokens one at a time and skips over comments, returning only the first non-comment token. Each skipped comment is nevertheless fully tokenized, allocated as a `Token` object, and linked into the persistent token list via `token.next` / `token.prev` — the chain that powers source-location reporting, and which is retained as long as the document is. `Parser.advance_lexer()` incremented the token counter only for the tokens the lexer actually returned. Comments were therefore invisible to the accounting, and `max_tokens` bounded only the *non-comment* tokens. The practical consequence is a gap between what users reasonably believe `max_tokens` protects and what it did protect. The limit was not broken for ordinary documents — real tokens were still capped correctly — so the shortfall was not observable without specifically testing comment padding. As with the companion issue, the payload compresses extremely well (`# c\n` repeated), so body-size limits and WAF inspection applied to the compressed request do not see its true size, while the framework decompresses it in memory before the parser is reached. ### Proof of concept ```python import gc import resource from graphql import parse # 100,000 comments, a 5-token query, and max_tokens=5 — accepted. query = "# c\n" * 100_000 + "{ a }" parse(query, max_tokens=5) # no error raised # Memory amplification. big = "# padding comment used to amplify memory per token\n" * 500_000 + "{ a }" gc.collect() before = resou

Properties

Severity
high
Summary
GraphQL-core: Denial of service via comment tokens bypassing the parser's max_tokens limit
Nvd fetched at
2026-10-23T02:14:06.697318+00:00
Cvss severity
HIGH
Cvss score
7.5
Retrieved at
2026-10-23T02:20:34+00:00
Ghsa published
2026-10-22T16:27:14Z
Source url
https://github.com/advisories/GHSA-r77w-qph3-7vf8
Ghsa updated
2026-10-22T16:27:14Z
Ghsa id
GHSA-r77w-qph3-7vf8
Last source
GitHub Advisory Database
Score
7.5
Cvss version
3.1
Cve id
CVE-2026-75508
Cvss vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
First seen by Signal
2026-10-22T18:12:34+00:00
Is ghsa only
false
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Published at
2026-10-22T17:16:59.933
Last modified
2026-10-22T17:40:46.877

Related Entities (4)

AFFECTS (1)

→[Software]pip/graphql-core

VULNERABLE_TO (1)

←[Software]pip/graphql-core

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-75508 (CVSS v3.1 7.5) — Ninja Signal Threat Intelligence | Ninja Signal