authlib
Affected
- introduced
0, fixed1.6.11(ecosystem)
Fixed versions
1.6.11
Fix
- Fixed version
1.6.11pip install --upgrade authlib==1.6.11
Advisory
Also known as: CVE-2026-41425, PYSEC-2026-25
Authlib: Cross-site request forging when using cache
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
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.
Medium Basis: The source's own band: MODERATE
0, fixed 1.6.11 (ecosystem)1.6.11
1.6.11pip install --upgrade authlib==1.6.11Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0