Oct 9, 2026·6 min read·43 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-133469 is an improper authentication and input type validation vulnerability in the xo-server component of Vates Xen Orchestra and Xen Orchestra Appliance (XOA). Due to Express cookie-parser JSON deserialization combined with loose truthiness validation and unvalidated Redis query construction, an unauthenticated attacker can supply an empty JSON object cookie (authenticationToken=j:{}) to bypass authentication and hijack the first valid active session token stored in the database. This flaw is actively exploited in the wild to gain administrative control over Xen Orchestra deployments and execute root-level commands on underlying XCP-ng and XenServer hypervisors.
CVE-2026-22816 (GHSA-w78c-w6vf-rw82) is a high-severity flaw in Gradle's dependency resolution engine affecting versions prior to 8.14.4 and versions 9.0.0 through 9.2.1. Due to improper error handling when transient network errors or connection failures exhaust their retry limits, Gradle fails to mark unreachable repositories as disabled and does not abort the resolution queue. Instead, it silently falls through to subsequent repositories configured in the build script. This behavior enables dependency confusion and supply chain attacks when an internal or primary repository experiences connectivity issues, unresolvable DNS, or domain registration lapses.
Gradle versions prior to 8.14.4 and 9.3.0 fail to classify certain fatal network transport exceptions, such as UnknownHostException and NoHttpResponseException, as critical failures during dependency resolution. When these exceptions occur and retry thresholds are exhausted, Gradle fails to disable the unreachable primary repository and instead falls through to subsequent repositories configured in the build script. An attacker capable of disrupting connectivity to an upstream repository can force the build tool to fetch malicious artifacts with matching coordinates from a downstream, untrusted repository.
NATS Server prior to versions 2.12.8 and 2.14.3 contains an incorrect authorization vulnerability (CWE-863) in its message tracing subsystem. When evaluating whether a connection is permitted to publish trace events to a destination subject specified in the Nats-Trace-Dest header, the server only checks standard client permissions and omits permission checks for leaf node connections. This allows a connected leaf node operator with restricted publishing privileges to emit internal trace events to unauthorized subjects and suppress standard message delivery using the Nats-Trace-Only header.
CVE-2026-63341 is a high-severity Denial of Service (DoS) vulnerability in the Aedes MQTT broker for Node.js affecting all versions prior to 1.1.1. The flaw stems from missing input validation on the hierarchical depth of incoming MQTT topic strings before they are passed to the underlying topic-matching engine, qlobber. Because qlobber enforces a hardcoded limit of 100 topic levels and throws a synchronous exception when this threshold is exceeded, an attacker can send a single MQTT packet containing 101 or more forward-slash-separated levels to trigger an uncaught exception that immediately terminates the Node.js broker process.
CVE-2026-61725 is a path traversal vulnerability (CWE-22) in the sevenz-rust2 Cargo package prior to version 0.21.1. The vulnerability occurs because the decompression utility fails to validate or sanitize archive entry filenames before joining them with the destination directory path via std::path::Path::join. An attacker who supplies a crafted 7z archive containing parent directory traversal sequences or absolute paths can write or overwrite arbitrary files on the host filesystem with the privileges of the extracting process.