CVE-2026-49265

OAuthLib: Timing Attack Vulnerability in PKCE code_verifier Comparison

Published Oct 13, 2026 CVSS 3.1 · 6.8 Medium EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical 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.

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)
Ubuntu USN Ubuntu USN USN-9188-1 OAuthLib vulnerabilities
History
Type Values Removed Values Added
First Time appeared Oauthlib
Oauthlib oauthlib
Vendors & Products Oauthlib
Oauthlib oauthlib
Type Values Removed Values Added
Metrics ssvc

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

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'}

Weaknesses
  • CWE-208

    Observable Timing Discrepancy

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 13, 2026, 4:19 PM
Reserved
May 28, 2026, 2:33 PM
Status
Deferred
Published
Oct 13, 2026, 4:17 PM
Modified
Oct 16, 2026, 8:04 PM