Oct 9, 2026·5 min read·20 visits
Strawberry GraphQL fails to validate the return types of synchronous permission functions, allowing unawaited coroutines to evaluate as True and bypass access control.
An authorization bypass vulnerability in Strawberry GraphQL between versions 0.217.0 and 0.326.1 occurs when a synchronous permission handler returns an awaitable object (such as an unawaited coroutine). Due to Python's truthiness rules, the unawaited coroutine is evaluated as True, leading to an immediate bypass of security policies.
Strawberry GraphQL is a widely utilized Python library designed to build GraphQL APIs. The framework supports validating fields through permission classes, which check if the requesting user possesses the required authorizations before executing the corresponding field resolvers. This mechanism supports both synchronous and asynchronous modes of operation.
Between versions 0.217.0 and 0.326.1, a flaw exists in how the library handles synchronous field permission checks that return awaitable objects. The vulnerability allows an unauthenticated or unauthorized remote attacker to bypass permission validations. The flaw originates in the PermissionExtension.resolve() method, which performs direct truthiness checks on results returned from synchronous permission functions.
This vulnerability introduces a risk of unauthorized data disclosure, as custom permission decorators can be silently bypassed. Field resolvers that were intended to be private or restricted become accessible to any client.
The vulnerability is caused by a design discrepancy in Python's evaluation of coroutine objects coupled with the limitation of the supports_sync utility in Strawberry GraphQL. The library checks the asynchronous status of a permission class via inspect.iscoroutinefunction(permission.has_permission). If a developer defines the has_permission method using a standard synchronous declaration (def), this check evaluates to False.
Consequently, execution is routed through the synchronous path inside PermissionExtension.resolve(). If the developer's synchronous implementation returns an unawaited coroutine—for example, by calling an internal asynchronous function or external database wrapper without an asynchronous loop—the permission class returns a coroutine object instead of a boolean value.
In Python, all coroutines and awaitable objects evaluate to True when evaluated in a boolean context. The synchronous resolver checks truthiness using 'if not permission.has_permission(...)'. Because the returned coroutine object evaluates to True, the if statement evaluates to False, skipping the unauthorized logic path. The library assumes the check succeeded and executes the resolver, resulting in an authorization bypass.
Here is a visual mapping of the vulnerable execution flow:
The vulnerability resides in the validation path of strawberry/permission.py. When checking permissions, the code originally executed the permission verification directly within an 'if not' statement.
Below is the vulnerable implementation within strawberry/permission.py:
def resolve(self, next_, source, info, **kwargs) -> Any:
for permission in self.permissions:
# Vulnerable: If has_permission returns a coroutine,
# 'not coroutine' is evaluated, which is always False.
if not permission.has_permission(source, info, **kwargs):
return self._on_unauthorized(permission)
return next_(source, info, **kwargs)The fix introduced in version 0.326.1 checks if the return value of has_permission is awaitable. If inspect.isawaitable(has_permission) returns True in a synchronous context, the system raises an exception rather than proceeding.
Below is the patched implementation:
def resolve(self, next_, source, info, **kwargs) -> Any:
for permission in self.permissions:
has_permission = permission.has_permission(source, info, **kwargs)
# Patched: Validate if an awaitable was returned in sync context
if inspect.isawaitable(has_permission):
# Close the coroutine to prevent resource leaks
if inspect.iscoroutine(has_permission):
has_permission.close()
# Fail closed by throwing an explicit exception
raise PermissionReturnedAwaitableInSyncContextError(permission)
if not has_permission:
return self._on_unauthorized(permission)
return next_(source, info, **kwargs)The fix ensures that any attempt to return an awaitable object inside a synchronous resolution path raises a PermissionReturnedAwaitableInSyncContextError exception. This causes the request to fail closed, preventing exposure of sensitive fields.
An attacker can exploit this bypass if a custom permission class evaluates authorization synchronously but delegates to asynchronous helpers. The exploit requires no special privileges and is executed over the network by sending a standard GraphQL query.
Below is a demonstration of how a vulnerable implementation behaves. The permission class is defined synchronously, but mistakenly returns an unawaited coroutine:
class VulnerableBypassPermission(BasePermission):
message = "Unauthorized Access"
def has_permission(self, source, info, **kwargs) -> Any:
async def verify_user():
# This logic should return False to deny access
return False
# Returns the coroutine object itself
return verify_user()When a request is submitted to the server for a field protected by VulnerableBypassPermission, the engine resolves the field synchronously. Because the returned coroutine object is inherently truthy, the bypass is completed, and the backend resolves the field despite the logic within verify_user evaluating to False.
The impact of this vulnerability is classified as High, with a CVSS v3.1 base score of 7.5. The vulnerability allows complete bypass of application-level access controls designed to secure specific GraphQL fields. An attacker can access sensitive information, administrative fields, or trigger operations they are unauthorized to execute.
Because the bypass occurs silently without logging an error or exception, detecting the exploitation via standard application logs can be difficult unless the application monitors the exact types of objects returned by permissions. The exploitation complexity is low, requiring only standard GraphQL query structures.
There is no integrity or availability impact as the flaw is an information leakage and access bypass. However, if the field resolver performs write operations (such as mutations executing under synchronous resolvers), integrity impact could also occur depending on the specific implementation.
To mitigate CVE-2026-107728, developers must upgrade the strawberry-graphql package to version 0.326.1 or higher. The upgraded library implements defensive checks to block the synchronous execution of awaitable objects.
For legacy deployments where immediate patching is not possible, developers must audit all BasePermission subclasses. Ensure that any has_permission function using standard def returns a primitive boolean. If asynchronous functions must be invoked, the method should be redeclared as async def.
A Semgrep rule can automate the identification of vulnerable patterns. The rule should flag any synchronous has_permission function that returns calls to functions known to return coroutines or awaitables.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
strawberry-graphql strawberry-graphql | >= 0.217.0, < 0.326.1 | 0.326.1 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-863 |
| Attack Vector | Network |
| CVSS Score | 7.5 |
| EPSS Score | 0.00353 |
| EPSS Percentile | 26.95% |
| Impact | High (Confidentiality) |
| Exploit Status | Proof of Concept |
| CISA KEV Status | Not Listed |
The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly prove that the actor has the authorization to do so.
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.