Every CVE Search/ Get API key

CVE-2026-49265

OAuthLib: Timing Attack Vulnerability in PKCE code_verifier Comparison

6.8 MediumFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
High
Privileges needed
None
User interaction
Required

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
None

Exploit likelihood

0.24%Down 0.1 points since Oct 14, 2026
90%50%10%1%

What each source reports

CVE List Score used 6.8

OAuthLib: Timing Attack Vulnerability in PKCE code_verifier Comparison

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.

Record
CVE-2026-49265
CVSS 3.1
6.8 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N
Weakness
CWE-208
Updated
2026-11-02
EUVDEUVD-2026-98833 6.8

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.

Record
EUVD-2026-98833
CVSS 3.1
6.8 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N
Updated
2026-11-02
GitHub AdvisoriesGHSA-xpv3-w29h-x7cv 6.8

Oauthlib: Timing Attack Vulnerability in PKCE code_verifier Comparison (CWE-208)

Summary

A timing side-channel vulnerability exists in the PKCE (RFC 7636) implementation of the Authorization Code Grant flow. The code_challenge_method_plain function uses Python's standard == operator for string comparison instead of a constant-time comparison function, potentially allowing timing-based attacks.

Affected Component

  • File: oauthlib/oauth2/rfc6749/grant_types/authorization_code.py
  • Functions: code_challenge_method_plain, code_challenge_method_s256
  • Vulnerability Type: CWE-208 (Observable Timing Discrepancy)

Technical Details

Python's == operator uses short-circuit evaluation when comparing strings:

  1. Returns False immediately if lengths differ
  2. Compares characters left-to-right, stopping at first mismatch

This means comparison time varies linearly with the length of the common prefix between the attacker-supplied verifier and the stored challenge, creating a measurable timing oracle.

Proof of Concept

Tested locally against oauthlib source (network jitter eliminated to isolate pure Python execution time):

| Input | Result | Time (10M iterations) | |---|---|---| | Wrong first char (B + A*49) | Fast reject | 0.34106s | | 49 chars correct (A*49 + B) | Deep compare | 0.37847s | | Difference | | 0.03741s |

The ~37ms delta over 10M iterations corresponds to nanosecond-level differences per call, which are statistically exploitable under controlled conditions.

Attack Scenario

  1. Attacker intercepts authorization_code via Custom URI Scheme Hijacking
  2. PKCE blocks token request — attacker lacks code_verifier
  3. Attacker sends repeated requests to /token endpoint measuring response times
  4. Using timing oracle, attacker recovers code_verifier character by character
  5. Attacker obtains Access Token → Account Takeover

Note: Practical exploitability is limited due to the single-use nature of authorization codes and real-world network noise. However, the vulnerable pattern should be corrected as a defense-in-depth measure.

Recommended Fix

Replace == with hmac.compare_digest() for constant-time comparison:

cr: Elvin Latifli

Record
GHSA-xpv3-w29h-x7cv
CVSS 3.1
6.8 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N
Weakness
CWE-208
Updated
2026-11-02
NVD 6.8

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.

Record
CVE-2026-49265
CVSS 3.1
6.8 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N
Weakness
CWE-208
Updated
2026-11-02
OSV 6.8

OAuthLib: Timing Attack Vulnerability in PKCE code_verifier Comparison

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.

Record
CVE-2026-49265
CVSS 3.1
6.8 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N
Weakness
CWE-208
Updated
2026-11-02
OSVDEBIAN-CVE-2026-49265 6.8

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.

Record
DEBIAN-CVE-2026-49265
CVSS 3.1
6.8 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N
Updated
2026-11-02
Show 9 moreShow less
OSVGHSA-xpv3-w29h-x7cv 6.8

Oauthlib: Timing Attack Vulnerability in PKCE code_verifier Comparison (CWE-208)

Summary

A timing side-channel vulnerability exists in the PKCE (RFC 7636) implementation of the Authorization Code Grant flow. The code_challenge_method_plain function uses Python's standard == operator for string comparison instead of a constant-time comparison function, potentially allowing timing-based attacks.

Affected Component

  • File: oauthlib/oauth2/rfc6749/grant_types/authorization_code.py
  • Functions: code_challenge_method_plain, code_challenge_method_s256
  • Vulnerability Type: CWE-208 (Observable Timing Discrepancy)

Technical Details

Python's == operator uses short-circuit evaluation when comparing strings:

  1. Returns False immediately if lengths differ
  2. Compares characters left-to-right, stopping at first mismatch

This means comparison time varies linearly with the length of the common prefix between the attacker-supplied verifier and the stored challenge, creating a measurable timing oracle.

Proof of Concept

Tested locally against oauthlib source (network jitter eliminated to isolate pure Python execution time):

| Input | Result | Time (10M iterations) | |---|---|---| | Wrong first char (B + A*49) | Fast reject | 0.34106s | | 49 chars correct (A*49 + B) | Deep compare | 0.37847s | | Difference | | 0.03741s |

The ~37ms delta over 10M iterations corresponds to nanosecond-level differences per call, which are statistically exploitable under controlled conditions.

Attack Scenario

  1. Attacker intercepts authorization_code via Custom URI Scheme Hijacking
  2. PKCE blocks token request — attacker lacks code_verifier
  3. Attacker sends repeated requests to /token endpoint measuring response times
  4. Using timing oracle, attacker recovers code_verifier character by character
  5. Attacker obtains Access Token → Account Takeover

Note: Practical exploitability is limited due to the single-use nature of authorization codes and real-world network noise. However, the vulnerable pattern should be corrected as a defense-in-depth measure.

Recommended Fix

Replace == with hmac.compare_digest() for constant-time comparison:

cr: Elvin Latifli

Record
GHSA-xpv3-w29h-x7cv
CVSS 3.1
6.8 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N
Weakness
CWE-208
Updated
2026-11-02
OSVPYSEC-2026-4114 6.8

Oauthlib: Timing Attack Vulnerability in PKCE code_verifier Comparison (CWE-208)

Summary

A timing side-channel vulnerability exists in the PKCE (RFC 7636) implementation of the Authorization Code Grant flow. The code_challenge_method_plain function uses Python's standard == operator for string comparison instead of a constant-time comparison function, potentially allowing timing-based attacks.

Affected Component

  • File: oauthlib/oauth2/rfc6749/grant_types/authorization_code.py
  • Functions: code_challenge_method_plain, code_challenge_method_s256
  • Vulnerability Type: CWE-208 (Observable Timing Discrepancy)

Technical Details

Python's == operator uses short-circuit evaluation when comparing strings:

  1. Returns False immediately if lengths differ
  2. Compares characters left-to-right, stopping at first mismatch

This means comparison time varies linearly with the length of the common prefix between the attacker-supplied verifier and the stored challenge, creating a measurable timing oracle.

Proof of Concept

Tested locally against oauthlib source (network jitter eliminated to isolate pure Python execution time):

| Input | Result | Time (10M iterations) | |---|---|---| | Wrong first char (B + A*49) | Fast reject | 0.34106s | | 49 chars correct (A*49 + B) | Deep compare | 0.37847s | | Difference | | 0.03741s |

The ~37ms delta over 10M iterations corresponds to nanosecond-level differences per call, which are statistically exploitable under controlled conditions.

Attack Scenario

  1. Attacker intercepts authorization_code via Custom URI Scheme Hijacking
  2. PKCE blocks token request — attacker lacks code_verifier
  3. Attacker sends repeated requests to /token endpoint measuring response times
  4. Using timing oracle, attacker recovers code_verifier character by character
  5. Attacker obtains Access Token → Account Takeover

Note: Practical exploitability is limited due to the single-use nature of authorization codes and real-world network noise. However, the vulnerable pattern should be corrected as a defense-in-depth measure.

Recommended Fix

Replace == with hmac.compare_digest() for constant-time comparison:

cr: Elvin Latifli

Record
PYSEC-2026-4114
CVSS 3.1
6.8 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N
Updated
2026-11-02
OSVUBUNTU-CVE-2026-49265 6.8

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.

Record
UBUNTU-CVE-2026-49265
CVSS 3.1
6.8 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N
Updated
2026-11-02
OSVAZL-108045 No score

CVE-2026-49265 affecting package python-oauthlib for versions less than 3.2.2-4

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.

Record
AZL-108045
Updated
2026-11-07
OSVopenSUSE-SU-2026:22103-1 No score

Security update for python-oauthlib

This update for python-oauthlib fixes the following issues:

  • CVE-2026-49264: Oauthlib : Unsafe JSONP callback injection in RevocationEndpoint allows arbitrary JavaScript response generation (bsc#1283526).
  • CVE-2026-49265: Oauthlib: Timing Attack Vulnerability in PKCE code_verifier Comparison (bsc#1283527).
Record
openSUSE-SU-2026:22103-1
Updated
2026-11-02
OSVSUSE-SU-2026:24139-1 No score

Security update for python-oauthlib

This update for python-oauthlib fixes the following issues:

  • CVE-2026-49264: Oauthlib : Unsafe JSONP callback injection in RevocationEndpoint allows arbitrary JavaScript response generation (bsc#1283526).
  • CVE-2026-49265: Oauthlib: Timing Attack Vulnerability in PKCE code_verifier Comparison (bsc#1283527).
Record
SUSE-SU-2026:24139-1
Updated
2026-11-02
OSVSUSE-SU-2026:24189-1 No score

Security update for python-oauthlib

This update for python-oauthlib fixes the following issues:

  • CVE-2026-49264: Oauthlib : Unsafe JSONP callback injection in RevocationEndpoint allows arbitrary JavaScript response generation (bsc#1283526).
  • CVE-2026-49265: Oauthlib: Timing Attack Vulnerability in PKCE code_verifier Comparison (bsc#1283527).
Record
SUSE-SU-2026:24189-1
Updated
2026-11-02
OSVSUSE-SU-2026:24246-1 No score

Security update for python-oauthlib

This update for python-oauthlib fixes the following issues:

  • CVE-2026-49264: Oauthlib : Unsafe JSONP callback injection in RevocationEndpoint allows arbitrary JavaScript response generation (bsc#1283526).
  • CVE-2026-49265: Oauthlib: Timing Attack Vulnerability in PKCE code_verifier Comparison (bsc#1283527).
Record
SUSE-SU-2026:24246-1
Updated
2026-11-02
OSVSUSE-SU-2026:4810-1 No score

Security update for python-oauthlib

This update for python-oauthlib fixes the following issues:

  • CVE-2026-49264: Oauthlib : Unsafe JSONP callback injection in RevocationEndpoint allows arbitrary JavaScript response generation (bsc#1283526).
  • CVE-2026-49265: Oauthlib: Timing Attack Vulnerability in PKCE code_verifier Comparison (bsc#1283527).
Record
SUSE-SU-2026:4810-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
oauthlib
PyPI
3.0.0 up to 4.0.0
4.0.0
python-oauthlib
Azure Linux:3
before 3.2.2-4
3.2.2-4
python-oauthlib
Debian:12
All versions, plus listed versions
3.2.2-13.2.2-23.2.2-33.2.2-43.3.1-13.3.1-2
None known
python-oauthlib
Debian:13
All versions, plus listed versions
3.2.2-33.2.2-43.3.1-13.3.1-2
None known
python-oauthlib
Debian:14
All versions, plus listed versions
3.2.2-33.2.2-43.3.1-13.3.1-2
None known
oauthlib
PyPI
3.0.0 up to 4.0.0, plus listed versions
3.0.13.0.23.1.03.1.13.2.0
Show 4 moreShow less
3.2.13.2.23.3.03.3.1
4.0.0
python-oauthlib
SUSE:Linux Micro 6.0
From an advisory covering 2 CVEs
before 3.2.2-159998.1.1
3.2.2-159998.1.1
python-oauthlib
SUSE:Linux Micro 6.2
From an advisory covering 2 CVEs
before 3.2.2-160000.3.1
3.2.2-160000.3.1
python-oauthlib
SUSE:Linux Enterprise Server 16.0
From an advisory covering 2 CVEs
before 3.2.2-160000.3.1
3.2.2-160000.3.1
python-oauthlib
SUSE:Linux Enterprise Server for SAP applications 16.0
From an advisory covering 2 CVEs
before 3.2.2-160000.3.1
3.2.2-160000.3.1
Show 10 moreShow less
Affected packages
PackageAffectedFixed
python-oauthlib
SUSE:Linux Enterprise Module for Public Cloud 15 SP4
From an advisory covering 2 CVEs
before 3.2.2-150400.12.10.1
3.2.2-150400.12.10.1
python-oauthlib
SUSE:Linux Enterprise Module for Python 3 15 SP7
From an advisory covering 2 CVEs
before 3.2.2-150400.12.10.1
3.2.2-150400.12.10.1
python-oauthlib
Ubuntu:16.04:LTS
All versions, plus listed versions
1.0.0-11.0.3-1
None known
python-oauthlib
Ubuntu:18.04:LTS
All versions, plus listed versions
2.0.1-12.0.4-12.0.6-1
None known
python-oauthlib
Ubuntu:20.04:LTS
All versions, plus listed versions
2.1.0-13.1.0-1ubuntu13.1.0-1ubuntu2
None known
python-oauthlib
Ubuntu:22.04:LTS
All versions, plus listed versions
3.1.0-23.1.1-13.2.0-13.2.0-1ubuntu0.1
None known
python-oauthlib
Ubuntu:24.04:LTS
All versions, plus listed versions
3.2.2-1
None known
python-oauthlib
Ubuntu:26.10
All versions, plus listed versions
3.3.1-1build13.3.1-2
None known
python-oauthlib
Ubuntu:26.04:LTS
All versions, plus listed versions
3.2.2-33.3.1-13.3.1-1build1
None known
python-oauthlib
openSUSE:Leap 16.0
From an advisory covering 2 CVEs
before 3.2.2-160000.3.1
3.2.2-160000.3.1

History

History
RecordedChangedSources
affectedOSV
affected
factsOSV
affected, aliases, references
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-49265 is a medium vulnerability (CVSS 6.8) in Oauthlib, published September 29, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.24%, the 15th percentile. Fixed in oauthlib 4.0.0.

References

Show 16 moreShow less
MoveEnter Open