Oct 9, 2026·6 min read·39 visits
A state leak in Strawberry GraphQL's legacy WebSocket handler causes naturally completed subscriptions to permanently consume connection slots under max_subscriptions_per_connection, enabling remote attackers to deny future subscription requests on persistent sessions.
An uncontrolled resource consumption vulnerability in Strawberry GraphQL allows unauthenticated remote attackers to trigger a Denial of Service on persistent WebSocket connections using the legacy graphql-ws protocol. When the server enforces max_subscriptions_per_connection, naturally terminating subscriptions are not cleared from memory registries, leading to exhaustion of connection slots.
Strawberry GraphQL is a Python library designed for building GraphQL APIs using type hints. Among its features, Strawberry supports real-time subscriptions over WebSockets. In asynchronous network environments, subscription endpoints often expose a substantial attack surface, as persistent connections consume system resources like memory sockets and task descriptors over extended periods. To protect these resources, developers can enforce limits such as max_subscriptions_per_connection to control the allocation of active streams per connection.
The vulnerability resides within Strawberry's implementation of the legacy graphql-ws WebSocket subscription protocol handler, specifically in the file strawberry/subscriptions/protocols/graphql_ws/handlers.py. This component manages the lifecycle of subscription generators and their corresponding execution tasks. However, under configurations where a connection-level subscription limit is enforced, the handler does not maintain clean lifecycle tracking.
Classified under CWE-400 (Uncontrolled Resource Consumption), the defect allows an attacker to exhaust the configured subscription capacity of a single persistent WebSocket connection. Because the internal registry fails to release reference mappings when subscriptions naturally terminate or complete, subsequent query operations on that connection are blocked. This creates a localized, application-level Denial of Service (DoS) condition on the affected session.
To execute subscriptions, Strawberry spawns asynchronous generators wrapped in asyncio.Task objects. The legacy graphql-ws handler tracks these operations using two distinct internal dictionary attributes: self.subscriptions, which maps an operation identifier to the active execution generator, and self.tasks, which maps the operation identifier to the driving asyncio.Task loop.
When a client issues a stop command, the handler invokes cleanup_operation(operation_id). This function closes the underlying generator, cancels the associated task, and deletes both dictionary entries. However, the handler handles naturally terminating subscriptions (such as single-yield subscriptions or finished query streams) through a different execution path inside the handle_async_results coroutine.
When a subscription completes naturally, the async for loop in handle_async_results terminates, and the handler transmits a CompleteMessage to the client. In the vulnerable versions, the function exits without performing any dictionary cleanup. Although the execution task has completed and exited the event loop, its reference persists within self.tasks and self.subscriptions. If the client submits multiple consecutive completed operations using unique IDs, the self.tasks mapping grows monotonically, eventually exhausting the limit specified by max_subscriptions_per_connection and blocking all subsequent subscription requests on that connection.
The state leak within the execution pathway of the legacy handler is illustrated by the following diagram:
The vulnerability is located within the handle_async_results coroutine before the implementation of the patch. In the vulnerable version, the final execution path lacked any mechanism to clean up the bookkeeping entries when the loop finished running:
# Vulnerable code in strawberry/subscriptions/protocols/graphql_ws/handlers.py
async def handle_async_results(
self,
operation_id: str,
result_source: AsyncIterator[ExecutionResult]
) -> None:
try:
async for result in result_source:
await self.send_message(DataMessage(type="data", id=operation_id, ...))
# Natural termination point of the generator loop
await self.send_message(CompleteMessage(type="complete", id=operation_id))
# [CRITICAL FLAW] Missing dictionary cleanup for self.subscriptions and self.tasks
except asyncio.CancelledError:
await self.send_message(CompleteMessage(type="complete", id=operation_id))The official fix resolved this omission by introducing a finally block to ensure dictionary cleanup under all termination scenarios, and by refactoring the cleanup_operation function to utilize safe, non-raising .pop() methods:
# Patched code in strawberry/subscriptions/protocols/graphql_ws/handlers.py
async def handle_async_results(
self,
operation_id: str,
result_source: AsyncIterator[ExecutionResult]
) -> None:
try:
async for result in result_source:
await self.send_message(DataMessage(type="data", id=operation_id, ...))
await self.send_message(CompleteMessage(type="complete", id=operation_id))
except asyncio.CancelledError:
await self.send_message(CompleteMessage(type="complete", id=operation_id))
finally:
# Ensure the bookkeeping is released upon any exit path
self.subscriptions.pop(operation_id, None)
self.tasks.pop(operation_id, None)This remediation provides complete coverage because python guarantees the execution of the finally block, whether the coroutine completes normally, receives a cancellation signal, or raises an unhandled exception. This design ensures that task counts cannot be artificially inflated.
Exploitation of this vulnerability requires that the target server utilizes the legacy graphql-ws sub-protocol and has max_subscriptions_per_connection configured to a non-zero integer. No authentication or special privileges are required to initiate the attack sequence.
An attacker initiates a standard WebSocket handshake targeting the /graphql route, requesting the graphql-ws sub-protocol during negotiation. Once connection acknowledgment is received, the attacker begins issuing sequential subscription initiation payloads using distinct id values. Each payload requests a query or subscription that immediately finishes, such as a query yielding a single static value.
After each sequence, the server returns the requested payload followed by a complete message. Because of the state leak, the server retains the mapping for each unique operation ID. After sending a number of operations equal to the server's configured limit, any subsequent start commands issued on that WebSocket connection are met with a Subscription limit reached error message. This effectively denies the user session the ability to perform legitimate operations until the connection is terminated and re-established.
The overall security impact of CVE-2026-107727 is classified as low, as reflected by its CVSS base score of 3.7. The vulnerability represents an availability-only risk (A:L) and does not threaten data confidentiality or integrity. Furthermore, exploitation is constrained to the attacker's own persistent connection session.
In standard deployment configurations, an attacker cannot target other users' active WebSockets. However, in deployments that utilize shared connection models, multiplexing reverse-proxies, or persistent connection pooling where multiple client logical sessions share a physical socket connection, the risk of cross-user impact increases. In such scenarios, an attacker can intentionally exhaust the pool, causing denial of service to other users sharing the gateway.
Because of the low impact and the high prerequisite of requiring legacy subscription configurations, the vulnerability has an extremely low EPSS score of 0.35%. It is not known to be exploited in the wild, nor is it associated with any active ransomware campaigns. However, it represents an architectural flaw that can cause operational instability under benign client usage patterns if client applications perform frequent subscription teardowns and initializations over persistent connections.
The primary resolution for CVE-2026-107727 is upgrading the Strawberry GraphQL library to version 0.327.2 or later, which incorporates the proper task release logic inside the execution handler.
If upgrading is not immediately possible, three primary mitigations can be implemented:
Disable the connection cap setting by removing the configuration value for max_subscriptions_per_connection on the GraphQL server endpoint. While the dictionary memory leak will still occur, the server will no longer block subsequent incoming subscriptions.
Migrate to the modern, specification-compliant graphql-transport-ws protocol, which is unaffected by this state-tracking bug and is natively supported by modern GraphQL clients.
Implement a client-side workaround that explicitly transmits a legacy stop frame whenever a subscription completes or yields its final payload, forcing the server to trigger its cleanup_operation subroutine.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L| Product | Affected Versions | Fixed Version |
|---|---|---|
Strawberry GraphQL strawberry-graphql | >= 0.312.3, < 0.327.2 | 0.327.2 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-400 |
| Attack Vector | Network (AV:N) |
| CVSS v3.1 Score | 3.7 (Low) |
| EPSS Score | 0.0035 (Percentile: 26.60%) |
| Exploit Status | PoC available |
| CISA KEV Status | Not listed |
The product does not properly control the allocation and maintenance of a limited resource, enabling an actor to influence the amount of resources consumed.
CVE-2026-9639 (GHSA-j93m-3j9p-m5m8) is a null pointer dereference vulnerability in Canonical LXD affecting versions 5.0.0 through 5.21.4 and 6.0 through 6.8. The flaw resides in the (*lxdBackend).CreateCustomVolumeFromBackup method within lxd/storage/backend_lxd.go. An authenticated attacker with the can_create_storage_volumes permission can upload a crafted custom volume backup tarball that omits the expires_at field on a snapshot entry, triggering an unhandled SIGSEGV panic and terminating the LXD daemon.
An operating system command injection vulnerability (CWE-78) exists in GeoNode versions prior to 5.1.0. The vulnerability occurs in the vector upload processing pipeline when handling user-supplied geospatial files. By supplying a crafted layer name containing shell metacharacters, an authenticated attacker with basic data upload privileges can execute arbitrary commands on the underlying server or container hosting the GeoNode application and Celery worker processes.
GeoNode versions prior to 5.0.3 contain an unrestricted file upload vulnerability (CWE-434) within the document and dataset ingestion architecture. Authenticated low-privileged users can bypass upload validation via direct REST API interactions, file extension masquerading, metadata mutation via PATCH requests, or malicious archive submissions. This allows attackers to store and serve dangerous file types, alter on-disk file references, or trigger path traversal and resource exhaustion during archive extraction.
CVE-2026-55649 is a stored Cross-Site Scripting (XSS) vulnerability in GeoNode versions prior to 5.0.3. The flaw exists because document abstract metadata fields are ingested via the metadata management pipeline and stored in the backend database without HTML sanitization or input neutralization. An authenticated attacker with privileges to create or edit document metadata can inject arbitrary HTML and JavaScript payloads into these fields. When another user, such as an administrator, views the affected document page or catalog listing, the unencoded payload is rendered into the Document Object Model (DOM) and executes within the victim's browser session.
CVE-2026-55622 (GHSA-qx75-2p3r-pwm5) is an improper access control vulnerability (CWE-284) in Canonical LXD and LXC Incus (tracked as GHSA-c9f5-j9c3-mhrg). In multi-tenant deployments utilizing project-based isolation, the REST API handler for instance creation via POST /1.0/instances verifies that the authenticated user has authorization in the destination project specified by the query parameter, but fails to verify whether the user holds read or view permissions for the source instance when executing a copy operation across projects. Consequently, an authenticated client restricted to a single project can clone instances or snapshots from unauthorized projects into their own project, resulting in complete disclosure of the target instance filesystem and embedded credentials.
An authorization bypass vulnerability in Canonical LXD (tracked as GHSA-7mr3-28h5-m5vx and CVE-2026-55621, and as GHSA-64f3-v33m-w89f in Linux Containers Incus) allows an authenticated user with restricted project access to copy custom storage volumes and volume snapshots from unauthorized projects. The flaw resides in the storagePoolVolumesPost REST API handler, which verifies permissions on the destination project but fails to check whether the caller holds view entitlements on the source project or volume specified in the request body.