Repository navigation
chore(deps): update dependency oauthlib to v4.0.1 [security] - #537
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
renovate
Bot
force-pushed
the
renovate/pypi-oauthlib-vulnerability
branch
from
November 9, 2026 23:10
2ef6933 to
879a0ff
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
4.0.0→4.0.1OAuthLib: Bearer token can be retrieved as long as client knows a valid client ID for device workflow
CVE-2026-49272 / GHSA-3jp2-3mrg-2vxc
More information
Details
Summary
A call to the token endpoint with a grant type of
"urn:ietf:params:oauth:grant-type:device_code"and a bogusdevice_codeis 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 says that the token endpoint should take in
device_codeas a required parameter.DeviceCodeGrant.validate_token_requestdoes not perform any validation ofdevice_code.DeviceCodeGrant.validate_token_requestshould be validating thatdevice_codewas passed in as a parameter and that it is valid, similar to howAuthorizationCodeGrant.validate_token_requestdoes the checks here and here.I would like to propose a new method be added to
RequestValidatorcalledvalidate_device_codethat is similar to thevalidate_codemethod and is called inside ofDeviceCodeGrant.validate_token_request.PoC
Create an implementation of
RequestValidation.authenticate_clientthat returnsTrueif the client'sclient_typeis"public". You would find yourself in this scenario because there's another issue withDeviceCodeGrant.validate_token_requestwhere it doesn't properly handle public clients (see https://github.com/oauthlib/oauthlib/issues/919).Create a client that has a
client_typeof"public"and set it'sgrant_typeto"urn:ietf:params:oauth:grant-type:device_code".With this implementation of
RequestValidation.authenticate_clientdone, use that validator for your token endpoint. Call the token endpoint with a body ofYou 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_codeparameter is not being validated.Severity
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
oauthlib/oauthlib (oauthlib)
v4.0.1: 4.0.1Compare Source
Security
device_codeparameter. A request with a knownclient_idand a bogusdevice_codecould obtain a bearer token.DeviceCodeGrant.validate_token_requestnow callsDeviceCodeGrant.validate_device_code(), which rejects missing or unknown device codes (invalid_request/invalid_grant) and delegates the code's authorization status to the newRequestValidator.validate_device_code()hook, per RFC 8628 Section 3.5. (cherry-picked from #954)Upgrade note for device flow integrators
Custom
RequestValidatorimplementations using the device flow must now implementvalidate_device_code(client_id, code, request). Return one of theDeviceCodeGrant.DEVICE_CODE_*statuses for known codes, orNonefor an unknown code. When returningAUTHORIZED, the validator must also populaterequest.userandrequest.scopesfrom the stored authorization.Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.