CVE-2026-40476: Webonyx/graphql php Denial of Service Vulnerability
MODERATECVE-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
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).
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.
Upgrade webonyx/graphql-php to 15.31.5
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
CVE-2026-40476 Affected Webonyx/graphql php Versions
1 component(s)| 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?
Which Webonyx/graphql php versions are affected?
What version fixes CVE-2026-40476?
Is webonyx/graphql-php affected?
What is the CVSS score of CVE-2026-40476?
What CWE is associated with CVE-2026-40476?
How can I check Packagist dependencies for CVE-2026-40476?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}