Strawberry
Strawberry GraphQL: Synchronous permission checks can treat an awaitable authorization result as truthy
Strawberry GraphQL is a library for creating GraphQL APIs. From 0.217.0 until 0.326.1, PermissionExtension.resolve() on a synchronous field resolver evaluates the result of has_permission() for truthiness. When a custom permission declares has_permission() as a normal function but returns an awaitable, supports_sync does not classify it as asynchronous, the awaitable is not awaited, and its inherently truthy object value permits the protected resolver to run even when the result would resolve to false. This affects synchronous field resolvers under both execute_sync() and execute(); permissions declared with async def has_permission() and synchronous permissions returning a boolean are not affected. This issue is fixed in version 0.326.1.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= 0.217.0, < 0.326.1
Fixed in 0.326.1
Mitigation
Upgrade strawberry to 0.326.1 or later.
References
- Vendor advisory github.com/strawberry-graphql/strawberry/secur…
- Patch github.com/strawberry-graphql/strawberry/pull/…
- Patch github.com/strawberry-graphql/strawberry/commi…
1 more
- Release notes github.com/strawberry-graphql/strawberry/relea…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.