CVE-2026-40476: Webonyx/graphql php Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-68jq-c3rv-pcrr
CVSS 7.5
CWE-407
Published
Advisory Summary

CVE-2026-40476 is a MODERATE (CVSS 7.5) denial of service vulnerability (CWE-407: Inefficient Algorithmic Complexity) affecting Webonyx/graphql php libraries in the Packagist ecosystem. The issue involves graphql-php is affected by a denial of service via quadratic complexity in overlappingfieldscanbemerged validation. Remediation is available by upgrading affected packages to version 15.31.5.

CVE-2026-40476 at a Glance

CVE Identifier CVE-2026-40476
GHSA Identifier GHSA-68jq-c3rv-pcrr
Severity MODERATE
CVSS v3.1 Base Score 7.5
CWE Classification CWE-407: Inefficient Algorithmic Complexity
Affected Product Webonyx/graphql php
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-40476

To remediate this vulnerability, upgrade all affected Webonyx/graphql php dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

webonyx/graphql-php fixed: 15.31.5
Upgrade webonyx/graphql-php to 15.31.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for webonyx/graphql-php

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-40476, inspect your project dependencies for Webonyx/graphql php:

inspect dependencies for webonyx/graphql-php

Analyze the terminal output to locate any version of Webonyx/graphql php in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 15.31.5), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-407: Inefficient Algorithmic Complexity, where an algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached. In Webonyx/graphql php, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

The `OverlappingFieldsCanBeMerged` validation rule exhibits quadratic time complexity when processing queries with many repeated fields sharing the same response name. An attacker can send a crafted query like `{ hello hello hello ... }` with thousands of repeated fields, causing excessive CPU usage during validation before execution begins. This is not mitigated by existing QueryDepth or QueryComplexity rules. **Observed impact (tested on v15.31.4):** - 1000 fields: ~0.6s - 2000 fields: ~2.4s - 3000 fields: ~5.3s - 5000 fields: request timeout (>20s) **Root cause:** `collectConflictsWithin()` performs O(n²) pairwise comparisons of all fields with the same response name. For identical repeated fields, every comparison returns "no conflict" but the quadratic iteration count causes resource exhaustion. **Fix:** Deduplicate structurally identical fields before pairwise comparison, reducing the complexity from O(n²) to O(u²) where u is the number of unique field signatures (typically 1 for this attack pattern). **Credit:** Ashwak N (ashwakn04@gmail.com)

CVE-2026-40476 Affected Webonyx/graphql php Versions

1 component(s)
Fixed Versions:
15.31.5
Product / Package Ecosystem Affected Versions Fixed Version
webonyx/graphql-php
Packagist
< 15.31.5
15.31.5

References

Frequently Asked Questions

What is CVE-2026-40476?
CVE-2026-40476 is a security vulnerability in Webonyx/graphql php involving graphql-php is affected by a Denial of Service via quadratic complexity in OverlappingFieldsCanBeMerged validation under CWE-407: Inefficient Algorithmic Complexity.
Which Webonyx/graphql php versions are affected?
Affected versions include releases prior to 15.31.5 across affected packages: webonyx/graphql-php.
What version fixes CVE-2026-40476?
Upgrading to 15.31.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is webonyx/graphql-php affected?
Yes, webonyx/graphql-php is affected in releases prior to 15.31.5. Upgrade your dependency to 15.31.5 or later.
What is the CVSS score of CVE-2026-40476?
CVE-2026-40476 has a CVSS v3.1 base score of 7.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-40476?
CVE-2026-40476 is classified under CWE-407: Inefficient Algorithmic Complexity (An algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached.).
How can I check Packagist dependencies for CVE-2026-40476?
Run the dependency tree command: 'inspect dependencies for webonyx/graphql-php'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-68jq-c3rv-pcrr",
  "modified" : "2026-06-08T23:09:48Z",
  "published" : "2026-04-14T01:05:05Z",
  "aliases" : [ "CVE-2026-40476" ],
  "summary" : "graphql-php is affected by a Denial of Service via quadratic complexity in OverlappingFieldsCanBeMerged validation",
  "details" : "The `OverlappingFieldsCanBeMerged` validation rule exhibits quadratic time complexity when processing queries with many repeated fields sharing the same response name. An attacker can send a crafted query like `{ hello hello hello ... }` with thousands of repeated fields, causing excessive CPU usage during validation before execution begins.\n\nThis is not mitigated by existing QueryDepth or QueryComplexity rules.\n\n**Observed impact (tested on v15.31.4):**\n- 1000 fields: ~0.6s\n- 2000 fields: ~2.4s\n- 3000 fields: ~5.3s\n- 5000 fields: request timeout (>20s)\n\n**Root cause:** `collectConflictsWithin()` performs O(n²) pairwise comparisons of all fields with the same response name. For identical repeated fields, every comparison returns \"no conflict\" but the quadratic iteration count causes resource exhaustion.\n\n**Fix:** Deduplicate structurally identical fields before pairwise comparison, reducing the complexity from O(n²) to O(u²) where u is the number of unique field signatures (typically 1 for this attack pattern).\n\n**Credit:** Ashwak N (ashwakn04@gmail.com)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "webonyx/graphql-php"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "15.31.5"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 15.31.4"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/webonyx/graphql-php/security/advisories/GHSA-68jq-c3rv-pcrr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40476"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/webonyx/graphql-php"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/webonyx/graphql-php/releases/tag/v15.31.5"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-407" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-14T01:05:05Z",
    "nvd_published_at" : "2026-04-17T22:16:33Z"
  }
}