highCVSS 8.2Vulnerability

GHSA-r7cg-qjjm-xhqq

## Summary `GraphQL\Language\Parser` is a recursive descent parser with no recursion depth limit and no `zend.max_allowed_stack_size` interaction. Crafted nested queries trigger a SIGSEGV in the PHP runtime, killing the FPM/CLI worker process. Smallest crashing payload is approximately 74 KB. ## Affected Component - `src/Language/Parser.php` -- the `Parser` class (no recursion depth tracking) - `src/Language/Lexer.php` -- the `Lexer` class ## Severity **HIGH (8.2)** -- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H Integrity is Low because the entire PHP process (FPM worker, CLI process, Swoole worker, RoadRunner worker, etc.) is terminated by SIGSEGV. Every concurrent request handled by the same process is dropped along with the attacker's request, with no error message, no log entry, and no recovery path beyond restart. The 74 KB minimum crashing payload sits well below any common HTTP body size limit, and the failure mode is **the worst possible**: not catchable, not observable, no diagnostics. ## Description `GraphQL\Language\Parser` parses GraphQL documents using mutually recursive PHP methods (`parseValueLiteral`, `parseObject`, `parseObjectField`, `parseList`, `parseSelectionSet`, `parseSelection`, `parseField`, `parseTypeReference`, `parseInlineFragment`). The constructor (`Parser.php:325`) accepts only three options: ```php // src/Language/Parser.php:64 /** * @phpstan-type ParserOptions array{ * noLocation?: bool, * allowLegacySDLEmptyFields?: bool, * allowLegacySDLImplementsInterfaces?: bool, * } */ ``` There is **no `maxTokens`, no `maxDepth`, no `maxRecursionDepth`, no token counter, and no recursion depth counter** anywhere in the parser or lexer. PHP recursion is bounded only by the C stack size (typically 8 MB via `ulimit -s 8192`). When the C stack is exhausted by graphql-php's recursive parser, **PHP segfaults**. The PHP 8.3 runtime ships with `zend.max_allowed_stack_size` (default 0 = auto-detect), which is supposed to convert

Properties

ghsa_id
GHSA-r7cg-qjjm-xhqq
summary
webonyx/graphql-php has unbounded recursion in parser that causes stack overflow on crafted nested input
severity
high
cvss_score
8.2
cve_id
GHSA-r7cg-qjjm-xhqq
cvss_vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H
is_ghsa_only
true
ghsa_published
2026-05-05T17:24:57Z
source_url
https://github.com/advisories/GHSA-r7cg-qjjm-xhqq
ghsa_updated
2026-05-05T17:24:58Z

Related Entities (4)

REPORTED_BY (1)

[Source]GitHub Advisory Database

VULNERABLE_TO (1)

[Software]composer/webonyx/graphql-php

AFFECTS (1)

[Software]composer/webonyx/graphql-php

HAS_WEAKNESS (1)

[Weakness]Uncontrolled Recursion

Explore deeper with Ninja Signal's threat intelligence graph

GHSA-r7cg-qjjm-xhqq (CVSS 8.2) — Ninja Signal Threat Intelligence | Ninja Signal