---
schema_version: '1.0'
id: security-20261028-941bcb
title: 'CVE-2026-49272: OAuthLib: Bearer token can be retrieved as long as client
  knows a valid client ID for device workflow'
url: https://osv.dev/vulnerability/GHSA-3jp2-3mrg-2vxc
url_hash: 941bcb82ef570db232734a6fda70f536d0846f50242201d37e34db7c63614d34
canonical_url: https://osv.dev/vulnerability/GHSA-3jp2-3mrg-2vxc
source: osv:ghsa
category: security/library
category_raw: cve/library
region: null
tags:
- cve
- CVE-2026-49272
- GHSA-3jp2-3mrg-2vxc
- severity:CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:N
- oauthlib
- PyPI
lang: en
published_at: '2026-10-27T13:30:17Z'
fetched_at: '2026-10-28T12:20:30.998824Z'
updated_at: '2026-11-06T11:06:21Z'
status: published
content_hash: ba0d5f272c236ff4c62612858d7b884dee3d34a3bd4d40394305b92d05989c20
content_changed_at: '2026-11-06T10:41:04.292414Z'
license_note: full
summary: 'OAuthLib: Bearer token can be retrieved as long as client knows a valid
  client ID for device workflow'
summary_source: rss
summary_en: 'OAuthLib: Bearer token can be retrieved as long as client knows a valid
  client ID for device workflow'
summary_omitted_reason: null
redistribution: true
keywords_en:
- AAVE Token
- Bearer
- CAN
- client
- cve
- CVE-2026-49272
- device
- for
- GHSA-3jp2-3mrg-2vxc
- knows
- library vulnerability
- long
- oauthlib
- PyPI
- retrieved
- severity:CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:N
- software security
- token
- valid
- workflow
entities_en:
- name: AAVE Token
  type: concept
- name: CAN
  type: organization
topics_en:
- library vulnerability
- software security
numeric_facts: []
entities:
- name: AAVE Token
  type: concept
- name: CAN
  type: organization
related_auto:
- name: Payward Inc.
  type: organization
  weight: 1.0
- name: Aave Labs
  type: UNKNOWN
  weight: 1.0
- name: Aave DAO Treasury
  type: UNKNOWN
  weight: 1.0
- name: Christian Association of Nigeria
  type: organization
  weight: 1.0
computed_at: '2026-11-06T11:05:56Z'
---

# CVE-2026-49272: OAuthLib: Bearer token can be retrieved as long as client knows a valid client ID for device workflow

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

## Key Points
- cve / CVE-2026-49272 / GHSA-3jp2-3mrg-2vxc / severity:CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:N / oauthlib / PyPI

## Details
**Severity:** CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:N
**Advisory:** GHSA-3jp2-3mrg-2vxc (CVE-2026-49272)

**Details:**
### Summary
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.

### Details

[Section 3.4 of the RFC 8628 spec](https://datatracker.ietf.org/doc/html/rfc8628#section-3.4) 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](https://github.com/oauthlib/oauthlib/blob/a015b446622f2b925517501fe484c10eff7a83c0/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py#L446) and [here](https://github.com/oauthlib/oauthlib/blob/a015b446622f2b925517501fe484c10eff7a83c0/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py#L483).

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

### PoC
Create an implementation of `RequestValidation.authenticate_client` that returns `True` if the client's `client_type` is `"public"`. You would find yourself in this scenario because there's another issue with `DeviceCodeGrant.validate_token_request` where it doesn't properly handle public clients (see https://github.com/oauthlib/oauthlib/issues/919).

Create a client that has a `client_type` of `"public"` and set it's `grant_type` to `"urn:ietf:params:oauth:grant-type:device_code"`.

With this implementation of `RequestValidation.authenticate_client` done, use that validator for your token endpoint. Call the token endpoint with a body of 
```
{
  "client_id": <ID of the public client you made>,
  "grant_type": "urn:ietf:params:oauth:grant-type:device_code",
  "device_code": <anything you want since it's not validated>
}
```

You now have a bearer token for the client without a valid `device_code`.


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

**References:**
- https://github.com/oauthlib/oauthlib/security/advisories/GHSA-3jp2-3mrg-2vxc
- https://github.com/oauthlib/oauthlib/pull/954
- https://github.com/oauthlib/oauthlib/commit/77a5f1c8ce00da2b0b8c5f6e9cc129920085f114
- https://github.com/oauthlib/oauthlib
- https://github.com/oauthlib/oauthlib/releases/tag/v4.0.1

_Data: OSV.dev (upstream: ghsa) — https://osv.dev/vulnerability/GHSA-3jp2-3mrg-2vxc_

## Source
元記事: [CVE-2026-49272: OAuthLib: Bearer token can be retrieved as long as client knows a valid client ID for device workflow](https://osv.dev/vulnerability/GHSA-3jp2-3mrg-2vxc) — published 2026-10-27T13:30:17Z
