# CVE-2025-68158: Authlib: 1-click Account Takeover

> Attackers can hijack user accounts via CSRF when cache-backed state storage is used, as state tokens are not tied to user sessions.

- **Severity:** Medium 5.7 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 8 Jan 2026
- **Updated:** 30 Mar 2026
- **Also known as:** DEBIAN-CVE-2025-68158, ECHO-9727-a15c-fedd, GHSA-fg6f-75jq-6523, MINI-2ww7-2mrm-vvq5, MINI-739w-f9m4-9ppc, PYSEC-2026-1201, SUSE-SU-2026:0828-1, UBUNTU-CVE-2025-68158, openSUSE-SU-2026:10034-1, openSUSE-SU-2026:20257-1

## What is CVE-2025-68158?

CVE-2025-68158 is a medium-severity vulnerability in authlib, published on 8 Jan 2026. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

### Official description

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.

Weakness: CWE-352 (Cross-Site Request Forgery)

## Which versions are affected by CVE-2025-68158?

3 open source packages ship an affected version, including authlib. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `authlib` | PyPI | From 1.0.0 | 1.6.6 |
| `authlib` | PyPI | From 1.0.0 | 1.6.6 |
| `authlib` | PyPI | From 1.0.0 | 1.6.6 |
| `python-Authlib` | SUSE:Linux Enterprise Module for Python 3 15 SP7 | All versions | 1.3.1-150600.3.14.1 |
| `python-Authlib` | openSUSE:Leap 15.6 | All versions | 1.3.1-150600.3.14.1 |
| `python-Authlib` | openSUSE:Leap 16.0 | All versions | 1.5.2-bp160.2.1 |
| `python-Authlib` | openSUSE:Tumbleweed | All versions | 1.6.6-1.1 |

Products: Authlib Authlib.

## How do I fix CVE-2025-68158?

Upgrade authlib to 1.6.6 or later.

## Is CVE-2025-68158 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-68158 exists.

## Other vulnerabilities in authlib

- [CVE-2026-27962](https://insights.sbomify.com/CVE-2026-27962/): Authlib JWS JWK Header Injection: Signature Verification Bypass (critical 9.1)
- [CVE-2026-28490](https://insights.sbomify.com/CVE-2026-28490/): Authlib Vulnerable to JWE RSA1_5 Bleichenbacher Padding Oracle (high 8.3)
- [CVE-2026-28498](https://insights.sbomify.com/CVE-2026-28498/): Authlib: Fail-Open Cryptographic Verification in OIDC Hash Binding (high 8.2)
- [CVE-2026-28802](https://insights.sbomify.com/CVE-2026-28802/): Authlib: Setting `alg: none` and a blank signature appears to bypass signature verification (high 7.7)
- [CVE-2025-61920](https://insights.sbomify.com/CVE-2025-61920/): Authlib is vulnerable to Denial of Service via Oversized JOSE Segments (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-68158 and fix it if it is affected.

What it is: CVE-2025-68158 is a medium-severity vulnerability in authlib, published on 8 Jan 2026. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-68158 exists.

Affected packages and fixed versions:
- authlib (PyPI): affected from 1.0.0; fixed in 1.6.6
- authlib (PyPI): affected from 1.0.0; fixed in 1.6.6
- authlib (PyPI): affected from 1.0.0; fixed in 1.6.6

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-68158/ (Markdown: https://insights.sbomify.com/CVE-2025-68158/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-68158
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-68158
- OSV: https://osv.dev/vulnerability/CVE-2025-68158

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-68158/
Summaries are generated and may contain mistakes; the official description above is the record.
