OAuthLib: Improper device code validation in device flow (CVE-2026-49272)
OAuthLib fails to validate the device_code parameter during device flow token requests, allowing attackers with a valid client ID to illicitly obtain bearer tokens.
CVE search metadata
CVE search record: CVE-2026-49272. KEV: no. Product: oauthlib (>= 3.3.0, < 4.0.0). Brief: OAuthLib: Improper device code validation in device flow (CVE-2026-49272). Brief link: https://feed.craftedsignal.io/briefs/2026-10-oauthlib-device-code-bypass/
Triage facts
Revision 1- Applicability
- oauthlib (>= 3.3.0, < 4.0.0)
- Evidence
- Unknown
- Severity
- High
- Action
- Elevated
- Sources
- 2 public sources
- Freshness
- Revision 1Oct 30, 09:04 UTC
- Vulnerabilities
- 1 CVE
- Source quality
- A1Likely
OAuthLib versions 3.3.0 through 3.x are affected by an authentication bypass vulnerability in the OAuth 2.0 Device Authorization Grant implementation (RFC 8628). Specifically, the DeviceCodeGrant.validate_token_request method fails to verify the device_code parameter. An attacker possessing a valid client_id that is configured for the device workflow can submit an OAuth token request with a fabricated or arbitrary device_code value to successfully receive a bearer token. This flaw bypasses the intended device authorization handshake.
Impact
Successful exploitation allows unauthorized generation of bearer tokens for applications utilizing the affected OAuthLib version for device flow authentication, potentially leading to unauthorized access to protected resources.
Recommendation
- Identify all internal services or products utilizing OAuthLib versions 3.3.0 through 3.x for OAuth 2.0 Device Authorization Grant workflows.
- Upgrade affected deployments to a patched version once available from the maintainers.
- If an immediate upgrade is not feasible, implement custom validation logic within the
RequestValidatorto manually verify thedevice_codebefore callingDeviceCodeGrant.validate_token_request. - Audit OAuth server logs for token requests using
grant_type=urn:ietf:params:oauth:grant-type:device_codethat lack a corresponding successful device authorization initiation.
Immediate actions
Inventory applications using OAuthLib for device flow workflows
Threat Hunt
Identify abnormal frequency or suspicious source IPs making token requests using the device code grant type
Data: OAuth token endpoint logs, HTTP Request parameters
Mitigations
Upgrade to the latest version of oauthlib once released
CVE-2026-49272