Skip to main content
Vulnerability Database/CVE-2026-107728

CVE-2026-107728: Strawberry GraphQL Auth Bypass Vulnerability

CVE-2026-107728 is an authentication bypass flaw in Strawberry GraphQL affecting versions 0.217.0 to 0.326.1. This vulnerability allows unauthorized access when custom permissions return awaitables in synchronous resolvers. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-107728 Overview

CVE-2026-107728 is an authorization bypass vulnerability [CWE-863] in Strawberry GraphQL, a Python library for building GraphQL APIs. The flaw affects versions 0.217.0 through 0.326.0. The PermissionExtension.resolve() method evaluates the result of has_permission() for truthiness on synchronous field resolvers. When a custom permission class declares has_permission() as a normal function but returns an awaitable, Strawberry's supports_sync check fails to classify it as asynchronous. The awaitable is never awaited, and its truthy object value grants access even when the intended boolean result would be False. Attackers can reach protected resolvers and read restricted data without authorization.

Critical Impact

Remote, unauthenticated attackers can bypass GraphQL field-level permissions and access data that should be gated by custom permission classes.

Affected Products

  • Strawberry GraphQL versions 0.217.0 through 0.326.0
  • Python applications exposing GraphQL schemas via execute_sync() or execute() with synchronous field resolvers
  • Custom permission classes implementing has_permission() as a plain def returning an awaitable

Discovery Timeline

  • 2026-10-08 - CVE-2026-107728 published to NVD
  • 2026-10-14 - Last updated in NVD database

Technical Details for CVE-2026-107728

Vulnerability Analysis

Strawberry GraphQL enforces field-level authorization through PermissionExtension, which calls has_permission() on each configured permission class before invoking the protected resolver. On the synchronous execution path, the extension inspects the returned value for truthiness rather than resolving it. The intended contract is that has_permission() returns a bool. When a developer accidentally defines has_permission() as a regular function that internally returns a coroutine (for example, by calling an async helper without await), the function returns an awaitable object. Any coroutine or Future is a non-None Python object and therefore evaluates as truthy. The permission check passes, and the resolver runs with the caller's data returned to the client. This condition affects both execute_sync() and execute() when the field itself is synchronous.

Root Cause

The root cause is a missing type check in PermissionExtension.resolve(). The supports_sync classifier inspects the function definition rather than the returned object, so an awaitable returned from a def function is treated as a direct result. Truthiness evaluation of the awaitable always yields True, silently converting a deny decision into an allow.

Attack Vector

An unauthenticated remote attacker sends a GraphQL query targeting any field protected by a vulnerable permission class. No special payload is needed; the attacker simply requests the protected field. Because the vulnerability is a logic defect in the server-side authorization pipeline, exploitation requires no privileges, no user interaction, and leaves no malformed traffic signature. Permissions declared with async def has_permission() and synchronous permissions returning a plain bool are not affected.

python
# Security patch in strawberry/exceptions/__init__.py
# Introduces a fail-closed error when a sync permission returns an awaitable.
class PermissionReturnedAwaitableInSyncContextError(Exception):
    """A permission returned an awaitable while being resolved synchronously.

    Raised when a permission's ``has_permission`` returns an awaitable (for
    example a plain ``def`` that returns a coroutine) but the field is being
    resolved on the synchronous path, where the awaitable cannot be awaited.
    Returning it as-is would be truthy and silently grant access, so we fail
    closed instead.
    """

    def __init__(self, permission: object) -> None:
        self.permission = permission
        permission_name = type(permission).__name__
        message = (
            f"Permission {permission_name!r} returned an awaitable from "
            "`has_permission` but is being resolved synchronously, so the "
            "result cannot be awaited. Declare `has_permission` as "
            "`async def` so Strawberry runs it on the asynchronous path, or "
            "return a plain boolean."
        )
        super().__init__(message)

Source: GitHub Commit 2ebb7979

Detect Identity Attacks the Moment Authentication Fails

Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.

Stop Identity Attacks

Detection Methods for CVE-2026-107728

Indicators of Compromise

  • GraphQL query logs showing successful responses for fields that should be denied for the requesting user or anonymous session.
  • Unexpected absence of permission denial errors (for example, PermissionDenied) in application logs for permission-gated fields.
  • Access patterns where unauthenticated clients retrieve data from resolvers wrapped by custom permission classes.

Detection Strategies

  • Perform a static code review of all permission classes that subclass BasePermission and confirm has_permission() is declared async def or returns a plain bool.
  • Audit installed package versions and flag any strawberry-graphql release between 0.217.0 and 0.326.0 inclusive.
  • Add unit tests that invoke protected resolvers with an unauthorized context and assert that a denial, not data, is returned.

Monitoring Recommendations

  • Enable GraphQL request and response logging and alert on anomalous access rates to fields previously gated by permissions.
  • Monitor Python application logs for the new PermissionReturnedAwaitableInSyncContextError after upgrading, which indicates a latent misdeclared permission.
  • Correlate authentication state with field access using a SIEM to detect anonymous clients reading permission-protected data.

How to Mitigate CVE-2026-107728

Immediate Actions Required

  • Upgrade strawberry-graphql to version 0.326.1 or later.
  • Review every custom permission class and convert has_permission() to async def or ensure it returns a plain boolean synchronously.
  • Rotate any secrets or tokens that may have been exposed through fields protected only by an affected permission class.

Patch Information

The fix is published in Strawberry GraphQL release 0.326.1 via pull request #4605. Full details are available in GitHub Security Advisory GHSA-pfvf-fwfp-25mp. The patch introduces PermissionReturnedAwaitableInSyncContextError, which fails closed when a synchronous permission returns an awaitable instead of silently granting access.

Workarounds

  • Redeclare every has_permission() method as async def so Strawberry routes execution through the asynchronous path that correctly awaits the result.
  • Where async is not acceptable, rewrite the permission body to compute and return a plain bool without invoking coroutines.
  • Add a wrapper that calls asyncio.run() or inspect.isawaitable() inside has_permission() to collapse awaitables into booleans before returning.
bash
# Upgrade to the patched release
pip install --upgrade "strawberry-graphql>=0.326.1"

# Verify the installed version
python -c "import strawberry; print(strawberry.__version__)"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.