{"id":"CVE-2026-40476","aliases":["CVE-2026-40476","GHSA-68jq-c3rv-pcrr"],"related":[],"kind":"vulnerability","state":"published","title":"graphql-php: Denial of Service via quadratic complexity in OverlappingFieldsCanBeMerged validation","summary":"graphql-go is a Go implementation of GraphQL. In versions 15.31.4 and below, the OverlappingFieldsCanBeMerged validation rule performs O(n²) pairwise comparisons of fields sharing the same response name. An attacker can send a query with thousands of repeated identical fields, causing excessive CPU usage during validation before execution begins. This is not mitigated by existing QueryDepth or QueryComplexity rules. This issue has been fixed in version 15.31.5.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"graphql-go is a Go implementation of GraphQL. In versions 15.31.4 and below, the OverlappingFieldsCanBeMerged validation rule performs O(n²) pairwise comparisons of fields sharing the same response name. An attacker can send a query with thousands of repeated identical fields, causing excessive CPU usage during validation before execution begins. This is not mitigated by existing QueryDepth or QueryComplexity rules. This issue has been fixed in version 15.31.5.","source":"cvelist"},{"lang":"en","text":"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)","format":"markdown","source":"ghsa"},{"lang":"es","text":"graphql-go es una implementación de GraphQL en Go. En las versiones 15.31.4 e inferiores, la regla de validación OverlappingFieldsCanBeMerged realiza comparaciones por pares O(n²) de campos que comparten el mismo nombre de respuesta. Un atacante puede enviar una consulta con miles de campos idénticos repetidos, causando un uso excesivo de la CPU durante la validación antes de que comience la ejecución. Esto no se mitiga por las reglas existentes de QueryDepth o QueryComplexity. Este problema ha sido solucionado en la versión 15.31.5.","source":"nvd"}],"published":"2026-04-14T01:05:05.000Z","modified":"2026-10-26T21:10:00.170Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-407"],"affected":[{"ranges":[{"version":"< 15.31.5","status":"affected"}],"vendor":"webonyx","product":"graphql-php","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"15.31.5"}],"ecosystem":"Packagist","package":"webonyx/graphql-php","purl":"pkg:composer/webonyx/graphql-php","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"15.31.5"}],"vendor":"webonyx","product":"graphql-php","cpe":"cpe:2.3:a:webonyx:graphql-php:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/webonyx/graphql-php/security/advisories/GHSA-68jq-c3rv-pcrr","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/webonyx/graphql-php/releases/tag/v15.31.5","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"http://www.openwall.com/lists/oss-security/2026/09/14/26","tags":[],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40476","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/webonyx/graphql-php","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-04-20T14:53:06.028Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-40476","url":"https://www.cve.org/CVERecord?id=CVE-2026-40476","licence":"CVE Terms of Use","modified":"2026-09-14T20:07:48.694Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-68jq-c3rv-pcrr","url":"https://github.com/advisories/GHSA-68jq-c3rv-pcrr","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:43.311Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-40476","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40476","licence":"Public domain","modified":"2026-10-26T21:10:00.170Z"}],"updatedAt":"2026-11-25T22:59:18.975Z","epss":{"score":0.00883,"percentile":0.60243,"date":"2026-12-01T12:00:22.000Z"}}