All vulnerabilities

PyPI

CVE-2026-49272

OAuthLib: Bearer token can be retrieved as long as client knows a valid client ID for device workflow

Severity
High 8.5
Published
27 Oct 2026
Last changed
5 Nov 2026
Added to UpHeron
23 Nov 2026
Fixed in
4.0.1
Exploit chance
0.4% in the next 30 daysHigher than 30% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Improper authentication (CWE-287)
Attack
Over the network · Needs a user account · No user action needed
Attacker can
Read some data · Change data
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:N
Also known as
GHSA-3jp2-3mrg-2vxc
Sources
OSV.dev and GitHub

Description

A call to the token endpoint with a grant type of "urn:ietf:params:oauth:grant-type:device_code" and a bogus device_code is able to get a bearer token as long as they know a valid client ID enabled for the device workflow.

Section 3.4 of the RFC 8628 spec says that the token endpoint should take in device_code as a required parameter.DeviceCodeGrant.validate_token_request does not perform any validation of device_code. DeviceCodeGrant.validate_token_request should be validating that device_code was passed in as a parameter and that it is valid, similar to how AuthorizationCodeGrant.validate_token_request does the checks here and here.

I would like to propose a new method be added to RequestValidator called validate_device_code that is similar to the validate_code method and is called inside of DeviceCodeGrant.validate_token_request.

Anyone using the RFC 8628 device workflow in oauthlib that doesn't realize the device_code parameter is not being validated.

From the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
oauthlibPyPI · osv:PyPI:oauthlib
  • From 3.3.0 before 4.0.1

About oauthlib

Weekly downloads (PyPI)
62,846,170PyPI Stats, 23 Nov 2026

Vulnerabilities in oauthlib

In our list
2
Published in the last 12 months
2
Critical, last 12 months
0
High, last 12 months
2
Known exploited
0
Search the list for oauthlib

References