CVE-2025-68158·Python vulnerability
Authlib is a Python library which builds OAuth and OpenID Connect servers. In versions 1.0.0 through 1.6.5, cache-backed state/request-token storage is not tied to the initiating user session, so CSRF is possible for any attacker that has a valid state (easily obtainable via an attacker-initiated authentication flow). When a cache is supplied to the OAuth client registry, FrameworkIntegration.set_state_data writes the entire state blob under _state_{app}_{state}, and get_state_data ignores the caller’s session altogether. This issue has been patched in version 1.6.6.
- Severity
- medium
- Software
- Python
- Fixed in
- 1.6.6
- Published
- 2026-01-08
Affected versions
Until: 1.6.6
Fixed in: 1.6.6
How to fix this CVE
Upgrade Authlib to version 1.6.6 or later to resolve a session-validation bypass in OAuth state management. This patch ensures that cached state tokens are properly tied to user sessions, eliminating the CSRF vulnerability. If you are using Authlib as a dependency in your Python application, update it immediately through your package manager or requirements file.
sudo dnf update python3-authlibDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check installed Authlib version with `python3 -c "import authlib; print(authlib.__version__)"`
- Step 2: Review your application's requirements.txt or setup.py to identify if authlib is explicitly pinned to a vulnerable version (< 1.6.6)
- Step 3: Search application logs for OAuth state validation errors or repeated /authorize endpoint requests from different users with identical state values
- Step 4: After patching, confirm the version with `python3 -c "import authlib; print(authlib.__version__)"` and restart your OAuth service
FAQ
What is CVE-2025-68158?
CVE-2025-68158 is a CSRF vulnerability in Authlib's OAuth client state management where cached tokens are not bound to user sessions, allowing attackers to reuse valid state values across different users to hijack authentication flows.
Is CVE-2025-68158 being actively exploited?
No, there are no known public exploits or evidence of active exploitation in the wild according to CISA's Known Exploited Vulnerabilities catalog.
What versions of Authlib are affected by CVE-2025-68158?
Authlib versions 1.0.0 through 1.6.5 are vulnerable. Version 1.6.6 and later contain the security fix.
How do I check if my server is vulnerable to CVE-2025-68158?
Run `python3 -c "import authlib; print(authlib.__version__)"` and compare the version against 1.6.6; if your version is 1.6.5 or earlier, you are vulnerable.
Does Defensia detect CVE-2025-68158?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Authlib is installed on a monitored server, CVE-2025-68158 will appear in your dashboard with remediation steps.
Related Python CVEs
References
- https://github.com/authlib/authlib/commit/2808378611dd6fb2532b189a9087877d8f0c0489
- https://github.com/authlib/authlib/commit/7974f45e4d7492ab5f527577677f2770ce423228
- https://github.com/authlib/authlib/security/advisories/GHSA-fg6f-75jq-6523
- https://github.com/authlib/authlib/security/advisories/GHSA-fg6f-75jq-6523
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2025-68158. Free for 1 server.
Get started free