Oct 9, 2026·5 min read·2 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.
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.
A high-severity type-confusion vulnerability exists in NearForm fast-jwt prior to version 6.3.0. The vulnerability allows attackers to bypass crucial claim validation steps (such as expiration, issuer, audience, and subject validations) by presenting a validly signed JSON Web Token structured as a JSON array instead of a JSON object. This occurs because the library's decoder fails to reject JSON arrays during type evaluation.
NearForm fast-jwt prior to version 6.3.0 is vulnerable to an input validation flaw where configuring verifier properties (such as clockTolerance, clockTimestamp, and cacheTTL) with non-finite values like Infinity or NaN allows attackers to bypass temporal claim validations, including expiration (exp) and activation (nbf) boundaries. This validation bypass can result in unauthorized session persistence and cache poisoning.
A critical cryptographic vulnerability in fast-jwt versions 6.2.x prior to 6.3.0 allows unauthenticated remote attackers to execute an asymmetric-to-symmetric algorithm confusion attack due to incomplete validation of leading non-whitespace prefixes.
CVE-2026-107720 is a critical signature verification bypass vulnerability in NearForm's fast-jwt Node.js library. Under specific configurations where the token verifier is initialized with a falsy cryptographic key (such as an empty string or null) and a non-empty algorithms allowlist, the library erroneously skips signature validation. This allows unauthenticated remote attackers to submit fabricated, unsigned JSON Web Tokens and bypass the authorization boundary of the application entirely.
Ruby Mechanize prior to version 2.14.1 contains an information disclosure vulnerability. When executing cross-origin HTTP redirects, global headers configured on the Mechanize agent (such as Authorization or Session Cookies) are dynamically re-applied to the subsequent request, bypassing the internal header-stripping logic. An attacker who controls a redirection endpoint can capture sensitive bearer tokens or cookies.