mediumCVSS 5.4Vulnerability

GHSA-jj8c-mmj3-mmgv

### Summary There is no CSRF protection on the cache feature on most integrations clients. ### Details In `authlib.integrations.starlette_client.OAuth`, no CSRF protection is set up when using the cache parameter. When _not_ using the cache parameter, the use of SessionMiddleware ties the client to the auth state, preventing CSRF attacks. With the cache, there is no such mechanism. Other integratons have the same issue, it's not just starlette. The state parameter is taken from the callback URL and the state is fetched from the cache without checking that it is the same client calling the redirect endpoint as was the one that initiated the auth flow. This issue is documented in RFC 6749 section 10.12: https://datatracker.ietf.org/doc/html/rfc6749#section-10.12 ### PoC - Set up a Starlette integration with a cache - The attacker starts the auth flow up until before the callback URL is followed. - The attacked sends the redirect URL to the victim - The victim now completes the authorisation ### Impact This impacts all users that use the cache to store auth state. All users will be vulnerable to CSRF attacks and may have an attacker's account tied to their own. In our specific scenario, this allowed attackers to push invoices into a victim's account, ready to be paid. Very serious.

Properties

ghsa_id
GHSA-jj8c-mmj3-mmgv
severity
medium
summary
Authlib: Cross-site request forging when using cache
cvss_score
5.4
cve_id
GHSA-jj8c-mmj3-mmgv
cvss_vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
is_ghsa_only
true
ghsa_published
2026-04-16T22:38:03Z
source_url
https://github.com/advisories/GHSA-jj8c-mmj3-mmgv
ghsa_updated
2026-04-16T22:38:04Z

Related Entities (4)

REPORTED_BY (1)

[Source]GitHub Advisory Database

VULNERABLE_TO (1)

[Software]pip/authlib

AFFECTS (1)

[Software]pip/authlib

HAS_WEAKNESS (1)

[Weakness]Cross-Site Request Forgery (CSRF)

Explore deeper with Ninja Signal's threat intelligence graph

GHSA-jj8c-mmj3-mmgv (CVSS 5.4) — Ninja Signal Threat Intelligence | Ninja Signal