chore(deps): update dependency authlib to v1.6.12 [security] #50
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.10→1.6.12Authlib: Cross-site request forging when using cache
CVE-2026-41425 / GHSA-jj8c-mmj3-mmgv / PYSEC-2026-25
More information
Details
Summary
There is no CSRF protection on the cache feature on most integrations clients.
Details
In
authlib.integrations.starlette_client.OAuth, no CSRF protection is set up when using the cache parameter. When not using the cache parameter, the use of SessionMiddleware ties the client to the auth state, preventing CSRF attacks. With the cache, there is no such mechanism. Other integratons have the same issue, it's not just starlette.The state parameter is taken from the callback URL and the state is fetched from the cache without checking that it is the same client calling the redirect endpoint as was the one that initiated the auth flow.
This issue is documented in RFC 6749 section 10.12:
https://datatracker.ietf.org/doc/html/rfc6749#section-10.12
PoC
Impact
This impacts all users that use the cache to store auth state.
All users will be vulnerable to CSRF attacks and may have an attacker's account tied to their own.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
CVE-2026-41425 / GHSA-jj8c-mmj3-mmgv / PYSEC-2026-25
More information
Details
Authlib is a Python library which builds OAuth and OpenID Connect servers. Prior to 1.6.11, there is no CSRF protection on the cache feature in authlib.integrations.starlette_client.OAuth. This vulnerability is fixed in 1.6.11.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:NReferences
This data is provided by OSV and the PyPI Advisory Database (CC-BY 4.0).
Authlib OIDC Implicit/Hybrid Authorization Vulnerable to Open Redirect
CVE-2026-44681 / GHSA-r95x-qfjj-fjj2 / PYSEC-2026-188
More information
Details
Summary
An unauthenticated open redirect in Authlib's
OpenIDImplicitGrantandOpenIDHybridGrantauthorization 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 theopenidscope.Details
Vulnerable code
OpenIDImplicitGrant.validate_authorization_requestinauthlib/oidc/core/grants/implicit.py: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
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.
d2a35158972fcd685436