CVE-2026-41425: 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.starletteclient.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.
Published Apr 16, 2026 · Updated Jun 5, 2026
Affected packages
authlib
- Ecosystem
- PyPI
- Affected
- < 1.6.11
- Fixed in
- 1.6.11
- Check
pip show authlib
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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.
Credited to JohnnyDeuss.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-114614
Authlib: is_secure_transport() loopback exemption can be bypassed with a userinfo component, allowing cleartext-HTTP URLs to non-loopback hosts
low2.6Oct 27, 2026CVE-2026-114615
Authlib incomplete algorithm-confusion fix permits HMAC forgery with prefixed public keys
high7.4Oct 27, 2026CVE-2026-114617
Authlib: ID token can disable its own nonce validation via the nonce_supported claim
medium4.2Oct 27, 2026CVE-2026-114618
Authlib: Default JWT bearer grant accepts assertions for the wrong audience
medium6.8Oct 27, 2026CVE-2026-114619
Authlib: OpenID implicit grant checks raw scope instead of allowed scope before issuing ID tokens
medium4.6Oct 27, 2026CVE-2026-114620
Authlib: Unvalidated request_uri fetch in JWT-secured authorization request (JAR) leading to SSRF
medium5.4Oct 27, 2026
