# CVE-2026-49265: OAuthLib: Timing Attack Vulnerability in PKCE code_verifier Comparison

> Timing side-channel in OAuthLib PKCE verification allows potential recovery of code_verifier, leading to unauthorized access token acquisition and account takeover.

- **Severity:** Medium 6.8 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 13 Oct 2026
- **Updated:** 13 Oct 2026
- **Also known as:** AZL-108045, CLEANSTART-2026-NO84858, CLEANSTART-2026-PQ13819, CLEANSTART-2026-ZA90599, DEBIAN-CVE-2026-49265, ECHO-e653-cb4c-55e4, GHSA-xpv3-w29h-x7cv, MINI-2v7c-jjpm-3w7c, MINI-53h7-j5h7-2hph, MINI-5x7v-qvf5-w7x9, MINI-69rq-gjc9-c2c5, MINI-6jmr-26v5-98gf, MINI-8f6j-fq6m-mwpf, MINI-g72g-rgvg-8mrq, MINI-g7qf-4qhw-prm3, MINI-gh99-523h-7836, MINI-grq2-rff9-gwgh, MINI-gx77-39x6-h8f7, MINI-h6w3-284m-9c2j, MINI-jj7q-35x5-4p5p, MINI-m4wx-v4r8-fjhw, MINI-q97p-jgp3-qvg4, MINI-rpcc-rm3g-x65v, MINI-rpmh-vpgp-hvq7, MINI-vw88-7mgc-wr36, MINI-w287-3qp2-p528, MINI-wj73-qq63-vvfm, MINI-wm32-mj95-j6pq, MINI-wxp2-xhf5-6c2q, MINI-x8w3-p25j-mw36, MINI-xp9j-pwrj-4cr9, PYSEC-2026-4114, UBUNTU-CVE-2026-49265

## What is CVE-2026-49265?

CVE-2026-49265 is a medium-severity vulnerability in oauthlib, published on 13 Oct 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

OAuthLib is an implementation of the OAuth request-signing logic for Python 3.6+. From 3.0.0 until 4.0.0, OAuthLib's PKCE checks in oauthlib/oauth2/rfc6749/grant_types/authorization_code.py compare attacker-supplied code_verifier values with stored challenges using ordinary string equality in code_challenge_method_plain and code_challenge_method_s256. Because the comparison can return after a length difference or the first mismatching character, repeated token endpoint measurements can reveal common-prefix timing information that could potentially allow recovery of the code_verifier, unauthorized access-token acquisition, and account takeover. Practical exploitation requires an intercepted, single-use authorization code and enough measurements to overcome real-world network noise; the local timing benchmark does not establish practical remote account takeover, so the weakness remains a defense-in-depth concern. This issue is fixed in version 4.0.0.

Weakness: CWE-208 (Observable Timing Discrepancy)

## Which versions are affected by CVE-2026-49265?

3 open source packages ship an affected version, including oauthlib.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `oauthlib` | PyPI | From 3.0.0 | 4.0.0 |
| `oauthlib` | PyPI | From 3.0.0 | 4.0.0 |
| `oauthlib` | PyPI | From 3.0.0 | 4.0.0 |

## How do I fix CVE-2026-49265?

Upgrade oauthlib to 4.0.0 or later.

## Is CVE-2026-49265 being exploited?

There is no known exploitation of CVE-2026-49265 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-49265 and fix it if it is affected.

What it is: CVE-2026-49265 is a medium-severity vulnerability in oauthlib, published on 13 Oct 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-49265 in the wild and no public exploit code.

Affected packages and fixed versions:
- oauthlib (PyPI): affected from 3.0.0; fixed in 4.0.0
- oauthlib (PyPI): affected from 3.0.0; fixed in 4.0.0
- oauthlib (PyPI): affected from 3.0.0; fixed in 4.0.0

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-2026-49265/ (Markdown: https://insights.sbomify.com/CVE-2026-49265/index.md)
```

## Sources

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

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