{"id":"CVE-2026-41425","aliases":["GHSA-jj8c-mmj3-mmgv","PYSEC-2026-25"],"title":"Authlib: Cross-site request forging when using cache","summary":"Authlib: Cross-site request forging when using cache","severity":"medium","cvss":5.4,"cvssVector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","vendor":"authlib","product":"authlib","ecosystem":"pip","affected":["authlib < 1.6.11"],"patched":["authlib 1.6.11"],"published":"2026-04-16","updated":"2026-09-10","sourceUpdated":"2026-09-10T03:51:02.254888942Z","source":"OSV","sourceUrl":"https://osv.dev/vulnerability/GHSA-jj8c-mmj3-mmgv","references":[{"url":"https://github.com/authlib/authlib/security/advisories/GHSA-jj8c-mmj3-mmgv"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41425"},{"url":"https://github.com/authlib/authlib"},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/authlib/PYSEC-2026-25.yaml"}],"tags":["osv","pip"],"epss":0.00106,"epssPercentile":0.01251,"ingestedAt":"2026-09-12T03:13:01.705Z","slug":"CVE-2026-41425","body":"## Overview\n\n### Summary\n\nThere is no CSRF protection on the cache feature on most integrations clients.\n\n### Details\nIn `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.\n\nThe 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.\n\nThis issue is documented in RFC 6749 section 10.12:\nhttps://datatracker.ietf.org/doc/html/rfc6749#section-10.12\n\n### PoC\n- Set up a Starlette integration with a cache\n- The attacker starts the auth flow up until before the callback URL is followed.\n- The attacked sends the redirect URL to the victim\n- The victim now completes the authorisation\n\n### Impact\nThis impacts all users that use the cache to store auth state.\n\nAll users will be vulnerable to CSRF attacks and may have an attacker's account tied to their own.\n\n## Affected packages\n\n- `authlib < 1.6.11`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `authlib 1.6.11`","depth":"sunlit","depthScore":30,"depthScoreParts":{"impact":29.7,"likelihood":0,"exploitation":0,"ransomware":0},"changes":[]}