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.
Published: 2026-10-13
Score: 6.8 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Potential account takeover via timing attack on OAuthLib PKCE code_verifier comparison
Action: Patch
AI Analysis

Impact

OAuthLib, an OAuth request‑signing library for Python, performs equality checks of the PKCE code_verifier against the stored code_challenge using ordinary string comparison. Because the comparison stops at the first mismatching byte or when lengths differ, an attacker who can observe timing for repeated requests can infer common prefixes of the verifier. This side‑channel could help recover the full code_verifier, which, if combined with an intercepted one‑time authorization code, might allow the attacker to request an access token and take over the associated account. The vulnerability is mitigated by using a constant‑time comparison routine, but practical remote exploitation would require gathering many measurements to overcome network latency noise, making it a defense‑in‑depth concern rather than an immediately exploitable weakness.

Affected Systems

The flaw exists in OAuthLib versions 3.0.0 through 3.x. (i.e., any release prior to 4.0.0). Users of the oauthlib package in these versions are affected.

Risk and Exploitability

The CVSS score of 6.8 indicates a moderate severity. The EPSS score is unavailable, and the vulnerability is not listed in CISA’s KEV catalog. The likely attack vector involves an attacker who has obtained an intercepted, single‑use authorization code and can perform repeated network measurements against the token endpoint to recover the code_verifier. Because the side‑channel relies on timing measurements, the feasibility of real‑world exploitation remains uncertain, and the issue is considered a threat that warrants mitigation rather than an active exploited vulnerability.

Generated by OpenCVE AI on October 13, 2026 at 18:03 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to OAuthLib 4.0.0 or later, which replaces the vulnerable comparison with a constant‑time implementation.
  • If an immediate upgrade is not possible, wrap the OAuthLib calls with a constant‑time string comparison function for the code_verifier before invoking the library to eliminate the timing leak.
  • Monitor OAuth flow logs for unexpected token exchanges, repeated failed verification attempts, or unusual patterns that might indicate a timing‑based attack attempt.

Generated by OpenCVE AI on October 13, 2026 at 18:03 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-xpv3-w29h-x7cv Oauthlib: Timing Attack Vulnerability in PKCE code_verifier Comparison (CWE-208)
History

Tue, 13 Oct 2026 17:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Tue, 13 Oct 2026 16:00:00 +0000

Type Values Removed Values Added
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.
Title OAuthLib: Timing Attack Vulnerability in PKCE code_verifier Comparison
Weaknesses CWE-208
References
Metrics cvssV3_1

{'score': 6.8, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-13T16:19:39.092Z

Reserved: 2026-05-28T14:33:01.180Z

Link: CVE-2026-49265

cve-icon Vulnrichment

Updated: 2026-10-13T16:19:35.841Z

cve-icon NVD

Status : Deferred

Published: 2026-10-13T16:17:20.713

Modified: 2026-10-16T20:04:29.760

Link: CVE-2026-49265

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-13T18:15:17Z

Weaknesses
  • CWE-208

    Observable Timing Discrepancy