Bump oauthlib from 3.3.1 to 4.0.1
Bumps oauthlib from 3.3.1 to 4.0.1.
Release notes
Sourced from oauthlib's releases.
4.0.1
Security
- CVE-2026-49272 / GHSA-3jp2-3mrg-2vxc: The device code flow token endpoint did not validate the
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.4.0.0
Introduction
The release 4.0.0 defines the foundation that enables AI contributions and will improve the maintenance of oauthlib by using AI agents, skills, code for both contributors and maintainers. It includes devcontainer, skills and cleanup of instructions.
What's Changed
Important: this release contains 2 breaking changes. See CHANGELOG.rst for details:
- Removed JSONP support from token revocation endpoint (#951)
- Client authentication validation reorganized across grants (#919, #920): the
grant_typeparameter is now validated before client authentication.
- Replace pyenv with uv in documentation and tooling by
@JonathanHuotin oauthlib/oauthlib#910- Improve github action to publish package by
@JonathanHuotin oauthlib/oauthlib#915- Add pre-commit to run linters, formatters, etc. on code changes by
@cclaussin oauthlib/oauthlib#918- Fix client authentication for DeviceCodeGrant when getting a token by
@hekhuiskin oauthlib/oauthlib#920- Add project URLs to this project's PyPI page by
@Flimmin oauthlib/oauthlib#921- Fix a typo in ServiceApplicationClient docstring. by
@rafalkrupinskiin oauthlib/oauthlib#923- Correct grammar in function help by
@verhovskyin oauthlib/oauthlib#924- Add Python 3.14 to the testing by
@cclaussin oauthlib/oauthlib#925- Initial python/uv/tox devcontainer by
@JonathanHuotin oauthlib/oauthlib#930- Fix ruff checks about unused variables by
@JonathanHuotin oauthlib/oauthlib#931- Drop EOL Python 3.8 from CI by
@auvipyin oauthlib/oauthlib#932- Set Open Collective username to 'oauthlib' by
@auvipyin oauthlib/oauthlib#933- pre-commit autoupdate 2026_02_21 by
@cclaussin oauthlib/oauthlib#934- Remove a trailing whitespace fo fix failing pre-commit by
@cclaussin oauthlib/oauthlib#935- Fix typos discovered by typos by
@cclaussin oauthlib/oauthlib#938- Add
resourceto Request._params by@juannyGin oauthlib/oauthlib#942- Release 3.4.0: Add OAuthLib Maintainer agent by
@JonathanHuotin oauthlib/oauthlib#950- Remove JSONP support from token revocation by
@JonathanHuotin oauthlib/oauthlib#951- Improve PKCE code comparison by
@JonathanHuotin oauthlib/oauthlib#963- Release 4.0.0: bump and update changelog by
@JonathanHuotin oauthlib/oauthlib#976New Contributors
@hekhuiskmade their first contribution in oauthlib/oauthlib#920@Flimmmade their first contribution in oauthlib/oauthlib#921@verhovskymade their first contribution in oauthlib/oauthlib#924@juannyGmade their first contribution in oauthlib/oauthlib#942Full Changelog: https://github.com/oauthlib/oauthlib/compare/v3.3.1...v4.0.0
Changelog
Sourced from oauthlib's changelog.
4.0.1 (2026-11-04):
OAuth2.0 Provider (Security):
Security: CVE-2026-49272 / GHSA-3jp2-3mrg-2vxc: The device code flow token endpoint did not validate the
device_codeparameter. A request with a knownclient_idand a bogusdevice_codecould obtain a bearer token.DeviceCodeGrant.validate_token_requestnow calls a newDeviceCodeGrant.validate_device_code()which rejects missing or unknown device codes (400 invalid_request/400 invalid_grant) and delegates the code's authorization status to a new requiredRequestValidator.validate_device_code()hook, per RFC 8628 Section 3.5. (cherry-picked from #954, merged as 1c91d64)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 (AUTHORIZED,PENDING,SLOW_DOWNorEXPIRED) for known codes, orNonefor an unknown code. When returningAUTHORIZED, the validator must also populaterequest.userandrequest.scopesfrom the stored authorization.4.0.0 (2026-09-28):
OAuth2.0 Provider:
- Breaking: #951: Removed JSONP support from token revocation endpoint. JSONP has been superseded by CORS for cross-origin requests. The
enable_jsonpparameter has been removed fromRevocationEndpointand thecallbackparameter has been removed fromprepare_token_revocation_request.- Breaking: #919, #920: Fixed
DeviceCodeGrant.validate_token_requesttrying to authenticate public clients. Client authentication validation has been reorganized and is now shared acrossAuthorizationCodeGrant,DeviceCodeGrant,RefreshTokenGrantandResourceOwnerPasswordCredentialsGrant: thegrant_typeparameter is validated before client authentication, so requests missinggrant_typenow return400 invalid_requestinstead of401 invalid_client.- #963: Improved PKCE code comparison
Misc:
- #904: Stop installing
examplesintosite-packages.- #930: Add devcontainer, Add Python3.14, Python3.14t.
- #931: Fix ruff checks about unused variables.
- #932: Dropped EOL Python 3.8 from CI.
- #934: Pre-commit hooks autoupdate.
- #938: Fix typos discovered by typos.
- Add OAuthLib Maintainer agent for automated issue/PR triage and release management.
Commits
6e3aa05Release 4.0.1: fix CVE-2026-49272 (device_code validation in device flow)77a5f1cMerge pull request #954 from hekhuisk/improve-device-workflow145a9a4Release 4.0.0: clarify changelog breaking changes and reformat entriesc8344d6Update CHANGELOG.rste172830Release 4.0.0: bump version to 4.0.0 and update changelog40b0ab5Merge pull request #963 from oauthlib/ft/pkcecode1b68ceaMerge pull request #920 from hekhuisk/validate-client-authenticationc951a1dOrganized validate_client functions for all grant to avoid mistake in grnat i...74664d3Improve PKCE code comparison9859b05Merge pull request #950 from oauthlib/feature/3.4.0-maintainer-agent- Additional commits viewable in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the Security Alerts page.
Summary by cubic
Bumps oauthlib from 3.3.1 to 4.0.1, fixing CVE-2026-49272 in the device code flow token endpoint. This upgrade also brings two breaking changes from 4.0.0 and requires an update for device flow integrators.
Migration
oauthlib4.0.0 removed JSONP support from the token revocation endpoint; theenable_jsonpparameter andcallbackparameter are gone.- Client authentication validation is reorganized:
grant_typeis now validated before client authentication, so missinggrant_typereturns 400invalid_requestinstead of 401invalid_client. - Custom
RequestValidatorimplementations using the device flow must now implementvalidate_device_code(client_id, code, request)and populaterequest.userandrequest.scopeswhen returningAUTHORIZED.