Description
OAuthLib is an implementation of the OAuth request-signing logic for Python 3.6+. From 3.3.0 until 4.0.1, OAuthLib's RFC 8628 device workflow does not require DeviceCodeGrant.validate_token_request to check that the device_code parameter is present and valid. A caller whose client request is accepted by the configured validator and who knows a valid client ID enabled for the device workflow can submit a missing or bogus device code to the token endpoint and obtain a bearer token without completing device authorization. This issue is fixed in version 4.0.1.
Published: 2026-11-05
Score: 8.5 High
EPSS: n/a
KEV: No
Impact: Unauthorized bearer token acquisition
Action: Immediate Patch
AI Analysis

Impact

OAuthLib is an OAuth request-signing library for Python. From version 3.3.0 up to, but excluding, 4.0.1, the device flow implementation does not validate the device_code provided to the token endpoint when a client requests a token. A caller who knows a legitimate client ID can instead supply an empty or arbitrary device_code and still receive an access token, thereby bypassing the intended device authorization procedure. This results in unauthorized access to any resources the token scopes allow, making it an authentication bypass vulnerability classified as CWE‑287.

Affected Systems

The flaw exists in OAuthLib, a widely used OAuth 2.0 abstraction for Python projects. Any deployment that relies on OAuthLib versions from 3.3.0 through 4.0.1 is susceptible. The issue affects applications running on Python 3.6 and later that use the device authorization grant flow.

Risk and Exploitability

The flaw carries a CVSS score of 8.5, indicating high severity, but no EPSS score is available so current exploitation likelihood is unknown. It is not listed in the CISA KEV catalog. Exploitation requires only knowledge of a valid client ID, which is often publicly visible or discoverable, and access to the OAuth token endpoint, making it a realistic network‑based attack. Once an attacker obtains a bearer token, they can act with all permissions granted to the client, constituting a serious threat to confidentiality, integrity, and availability.

Generated by OpenCVE AI on November 5, 2026 at 22:21 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade OAuthLib to version 4.0.1 or later, which reinstates device_code validation.
  • If an upgrade is not immediately possible, modify the OAuth validation layer to reject token requests that lack a valid, non‑empty device_code parameter.
  • Audit existing client IDs and remove any that are unnecessary or exposed, and enforce strict configuration to limit device flow usage to approved services.

Generated by OpenCVE AI on November 5, 2026 at 22:21 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-3jp2-3mrg-2vxc OAuthLib: Bearer token can be retrieved as long as client knows a valid client ID for device workflow
History

Thu, 05 Nov 2026 23:00:00 +0000

Type Values Removed Values Added
First Time appeared Oauthlib
Oauthlib oauthlib
Vendors & Products Oauthlib
Oauthlib oauthlib

Thu, 05 Nov 2026 21:15:00 +0000

Type Values Removed Values Added
Description OAuthLib is an implementation of the OAuth request-signing logic for Python 3.6+. From 3.3.0 until 4.0.1, OAuthLib's RFC 8628 device workflow does not require DeviceCodeGrant.validate_token_request to check that the device_code parameter is present and valid. A caller whose client request is accepted by the configured validator and who knows a valid client ID enabled for the device workflow can submit a missing or bogus device code to the token endpoint and obtain a bearer token without completing device authorization. This issue is fixed in version 4.0.1.
Title OAuthLib: Bearer token can be retrieved as long as client knows a valid client ID for device workflow
Weaknesses CWE-287
References
Metrics cvssV3_1

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


Subscriptions

Oauthlib Oauthlib
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-11-05T21:14:43.982Z

Reserved: 2026-05-28T20:07:58.860Z

Link: CVE-2026-49272

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-11-05T21:18:50.447

Modified: 2026-11-05T22:18:44.593

Link: CVE-2026-49272

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-11-05T22:45:09Z

Weaknesses