Skip to main content
Vulnerability Database/CVE-2026-107376

CVE-2026-107376: GraphQL-PHP DOS Vulnerability

CVE-2026-107376 is a denial of service flaw in webonyx graphql-php that allows attackers to crash PHP processes through deeply nested GraphQL queries. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-107376 Overview

CVE-2026-107376 is an uncontrolled recursion vulnerability [CWE-674] in webonyx graphql-php, a PHP implementation of the GraphQL specification. The GraphQL\Language\Parser performs recursive descent without a recursion limit in parseSelectionSet, parseValueLiteral, and parseTypeReference. A remote attacker can submit deeply nested selection sets, object or list values, or list types that exhaust the PHP process stack during pre-validation parsing. The crash occurs before query validation and complexity controls run. The resulting SIGSEGV terminates PHP-FPM workers or long-running Swoole, RoadRunner, ReactPHP, or CLI processes. Application-level exception handlers cannot catch the fault. The issue is fixed in version 15.32.3.

Critical Impact

Unauthenticated remote attackers can crash GraphQL worker processes by sending a single deeply nested query, causing persistent denial of service against GraphQL APIs built on graphql-php.

Affected Products

  • webonyx graphql-php versions prior to 15.32.3
  • PHP-FPM applications exposing GraphQL endpoints via graphql-php
  • Long-running runtimes using graphql-php: Swoole, RoadRunner, ReactPHP, and CLI workers

Discovery Timeline

  • 2026-10-08 - CVE-2026-107376 published to NVD
  • 2026-10-08 - Last updated in NVD database

Technical Details for CVE-2026-107376

Vulnerability Analysis

The flaw sits in the recursive descent parser inside GraphQL\Language\Parser. Three parser methods, parseSelectionSet, parseValueLiteral, and parseTypeReference, call themselves to walk nested GraphQL constructs. None of these call sites checks a recursion depth counter before descending. An attacker who submits a query with thousands of nested braces, brackets, or list wrappers forces PHP to grow the C call stack until it overflows. Because the overflow happens inside the Zend engine, the process receives a SIGSEGV and exits.

Query complexity and depth limits that graphql-php ships with run only after parsing completes. The crash occurs during parsing, so those safeguards never execute. PHP try/catch blocks cannot intercept a segmentation fault, so the host process always dies.

Root Cause

The parser trusts untrusted input to govern recursion depth. The recursionLimit parser option existed but was not consistently applied across all recursive descent paths. The fix in commits 6c1d600 and 7b7f208 tightens the recursionLimit type and enforces the limit in the previously unguarded paths.

Attack Vector

The attack requires no authentication, no user interaction, and only network access to a GraphQL endpoint. An attacker sends a POST request containing a query, variable value, or type expression with recursion depth sufficient to exhaust the stack. Repeated requests keep killing worker processes as they respawn, producing sustained denial of service.

php
// Patch excerpt from src/Language/Parser.php tightening the recursionLimit type
 *   allowLegacySDLEmptyFields?: bool,
 *   allowLegacySDLImplementsInterfaces?: bool,
 *   experimentalFragmentVariables?: bool,
- *   recursionLimit?: int
+ *   recursionLimit?: int<0, max>
 * }
 *
 * - **noLocation**:
// Source: https://github.com/webonyx/graphql-php/commit/6c1d6009a0f7557f66753bcfd07badd15acf77f4

Detection Methods for CVE-2026-107376

Indicators of Compromise

  • PHP-FPM, Swoole, RoadRunner, or ReactPHP worker processes exiting with signal 11 (SIGSEGV) shortly after receiving GraphQL requests.
  • Web server error logs showing abrupt 502 Bad Gateway or upstream connection reset responses to /graphql requests.
  • Inbound GraphQL payloads with abnormally deep nesting of {, [, or list-of-list type expressions.

Detection Strategies

  • Inspect GraphQL request bodies at the ingress layer and count brace, bracket, and type-wrapper depth before forwarding to the application.
  • Correlate upstream 5xx bursts on GraphQL routes with PHP worker crash events in system logs.
  • Alert on graphql-php package versions below 15.32.3 detected during software composition analysis of PHP projects.

Monitoring Recommendations

  • Track worker restart rates and SIGSEGV counts on hosts running PHP GraphQL services.
  • Record and threshold the size and depth of GraphQL query payloads reaching the application.
  • Forward web server, PHP-FPM, and runtime (Swoole, RoadRunner) logs to centralized analytics for anomaly detection.

How to Mitigate CVE-2026-107376

Immediate Actions Required

  • Upgrade webonyx/graphql-php to version 15.32.3 or later across all PHP services exposing GraphQL endpoints.
  • Rebuild and redeploy container images, Swoole, RoadRunner, and ReactPHP workers that bundle the vulnerable library.
  • Audit API gateways and reverse proxies to reject GraphQL requests exceeding reasonable depth and size.

Patch Information

The fix is published in graphql-php v15.32.3. Technical details are documented in GHSA-r7cg-qjjm-xhqq. The patch enforces a bounded recursionLimit across parseSelectionSet, parseValueLiteral, and parseTypeReference, converting unbounded recursion into a catchable parser error.

Workarounds

  • Enforce request body size limits on GraphQL endpoints at the web server or reverse proxy, for example client_max_body_size in nginx.
  • Place a GraphQL-aware proxy or WAF rule in front of the API that rejects queries exceeding a maximum nesting depth.
  • Disable public GraphQL introspection and restrict endpoint access to authenticated clients until the upgrade is deployed.
bash
# Composer upgrade to the patched release
composer require webonyx/graphql-php:^15.32.3
composer show webonyx/graphql-php | grep versions

# Reload PHP-FPM / restart long-running workers after upgrade
sudo systemctl reload php-fpm
sudo systemctl restart roadrunner swoole-worker 2>/dev/null || true

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.