chore(deps): update dependency authlib to v1.6.12 [security] #82
No reviewers
Labels
No labels
bug
documentation
fonctionnalité
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
yaal/escut!82
Loading…
Reference in a new issue
No description provided.
Delete branch "renovate/pypi-authlib-vulnerability"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
1.6.9→1.6.12Authlib OAuth 2.0 has Open Redirect in Authorization API that allows attacker-controlled redirect_uri through unsupported response_type
CVE-2026-41479 / GHSA-w8p2-r796-3vmq / PYSEC-2026-2119
More information
Details
Summary
Authlib's OAuth 2.0 authorization endpoint can be turned into an unauthenticated open redirect when a request uses an unsupported response_type and supplies an attacker-controlled redirect_uri.
The vulnerable behavior happens before client lookup and before any redirect URI validation. As a result, an attacker does not need a valid client registration, an authenticated user, or any prior state. A single request to the authorization endpoint is enough to obtain a 302 Location response to an arbitrary attacker-controlled URL.
It was confirmed that the vulnerable code is present in tag v1.6.6 and in the current HEAD under test (68e6ab3fdfc71a328b1966bad5c6aba0f7d0c2e1, git describe: v1.6.6-104-g68e6ab3f). The issue was dynamically reproduced locally on the current HEAD.
Details
The root cause is that
AuthorizationServer.get_authorization_grant()copies the raw requestredirect_uriinto anUnsupportedResponseTypeErrorbefore any client has been resolved andbefore any redirect URI validation has happened:
OpenIDHybridGrant.validate_authorization_requestinauthlib/oidc/core/grants/hybrid.pyshares the same pattern.Root cause
Both methods perform the
openidscope presence check before delegating tosuper().validate_authorization_request(), which is whereAuthorizationEndpointMixin.validate_authorization_redirect_urivalidates the requestedredirect_uriagainst the client'scheck_redirect_uri(...). TheInvalidScopeErrorthrown by the scope check therefore carries attacker-controlledself.request.payload.redirect_uri.OAuth2Error.__call__inauthlib/oauth2/base.pyrenders any error with a non-emptyredirect_urias an HTTP 302:A malformed authorization request that selects
OpenIDImplicitGrantorOpenIDHybridGrantand omits theopenidscope is therefore redirected to a fully attacker-chosen URL.This is a variant of the issue fixed in commit
3be08468("fix: redirecting to unvalidatedredirect_urionUnsupportedResponseTypeError") that was missed in the OIDC Implicit and Hybrid grants.Preconditions
OpenIDImplicitGrantorOpenIDHybridGrant(standard OIDC Implicit or Hybrid flow support).response_typethat matches either grant:id_token,id_token token,code id_token,code token, orcode id_token token.scopedoes not containopenid.redirect_urivalue.No user authentication, no consent, no valid session, no CSRF token, and — notably — no valid
client_idare required. The scope check runs before any client lookup, so anyclient_idvalue (including nonexistent ones) reaches the vulnerable code path.PoC
The following unauthenticated GET is sufficient to induce the authorization server to redirect a victim's browser to an attacker-controlled URL:
Server response:
Impact
redirect_urithat has not been validated against the client's registered URIs, even in error responses. Thestateparameter is echoed back, giving the attacker site a stable correlator.Affected deployments
Any application using Authlib as an OIDC provider that registers
OpenIDImplicitGrantand/orOpenIDHybridGrant— i.e. anyone supporting the Implicit flow or the Hybrid flow (response_type=code id_token, etc.) — is affected. Clients of an Authlib-based OP are not directly affected; this is a server-side issue.Authorization servers that only register the plain
AuthorizationCodeGrant(code flow, with or without PKCE and theOpenIDCodeextension) are not affected by this specific variant: the code-flow grant validatesredirect_uribefore raising scope errors. If you were affected by the sibling issue fixed in3be08468(UnsupportedResponseTypeError), you should already be on1.6.10or later; this advisory is independent of that fix.Suggested fix
The attached
fix-oidc-open-redirect.patchreorders each method to delegate to its super (or callvalidate_code_authorization_requestfor Hybrid) first, and then performs theopenid-scope check with the validatedredirect_urivariable.An equivalent transform is applied to
OpenIDHybridGrant.validate_authorization_request, invokingvalidate_code_authorization_requestfirst and only then checkingis_openid_scope.Alternatively, inline a
client = query_client(request.payload.client_id)+client.check_redirect_uri(request.payload.redirect_uri)guard before populatingredirect_urion the error — the pattern used in3be08468.The patch also adds regression tests analogous to
test_unsupported_response_type_does_not_redirectfrom commit3be08468, assertingrv.status_code == 400andrv.headers.get("Location") is Nonefor an unregisteredredirect_uriwith a non-openidscope.Workarounds
No clean server-side workaround exists short of patching. Partial mitigations:
OpenIDImplicitGrantandOpenIDHybridGrantif the Implicit and Hybrid flows are not required. (RFC 9700 deprecates the Implicit flow and discourages Hybrid flows, so this is recommended anyway.)/authorizeendpoint with a reverse proxy rule that rejects requests containing both aredirect_uriparameter and ascopethat does not includeopenidwhenresponse_typematches the vulnerable set. This is fragile and not recommended as a primary control.References
3be08468— prior fix for the same class of issue inUnsupportedResponseTypeError(Authlib 1.6.10)5d2e603e):OpenIDImplicitGrant.validate_authorization_request—authlib/oidc/core/grants/implicit.pyOpenIDHybridGrant.validate_authorization_request—authlib/oidc/core/grants/hybrid.pyOAuth2Error.__call__—authlib/oauth2/base.py(renders errors withredirect_urias HTTP 302)AuthorizationEndpointMixin.validate_authorization_redirect_uri—authlib/oauth2/rfc6749/grants/base.py(the validation that is bypassed)Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
CVE-2026-44681 / GHSA-r95x-qfjj-fjj2 / PYSEC-2026-188
More information
Details
Authlib is a Python library which builds OAuth and OpenID Connect servers. Prior to 1.6.12 and 1.7.1, an unauthenticated open redirect in Authlib's OpenIDImplicitGrant and OpenIDHybridGrant authorization endpoint lets a remote attacker cause the authorization server to issue an HTTP 302 to an attacker-chosen URL by submitting an authorization request that omits the openid scope. This vulnerability is fixed in 1.6.12 and 1.7.1.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:NReferences
This data is provided by OSV and the PyPI Advisory Database (CC-BY 4.0).
Release Notes
authlib/authlib (authlib)
v1.6.12Compare Source
redirect_urionInvalidScopeErrorinOpenIDImplicitGrantandOpenIDHybridGrant.Full Changelog: https://github.com/authlib/authlib/compare/v1.6.11...v1.6.12
v1.6.11Compare Source
Full Changelog: https://github.com/authlib/authlib/compare/v1.6.10...v1.6.11
v1.6.10Compare Source
Full Changelog: https://github.com/authlib/authlib/compare/v1.6.9...v1.6.10
redirect_urionUnsupportedResponseTypeError.Configuration
📅 Schedule: (in timezone Europe/Paris)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate CLI.