chore(deps): [ai] Update dependency authlib to v1.6.12 [SECURITY]#479
Open
renovate-bot wants to merge 1 commit into
Open
chore(deps): [ai] Update dependency authlib to v1.6.12 [SECURITY]#479renovate-bot wants to merge 1 commit into
renovate-bot wants to merge 1 commit into
Conversation
fece523 to
d063a73
Compare
17116f3 to
d459293
Compare
d459293 to
f3e440f
Compare
804bba7 to
7a14e9e
Compare
3768ba2 to
c02e235
Compare
bed96f0 to
8ceb167
Compare
fd3b5fd to
86971f0
Compare
20aad8f to
1f5dfe3
Compare
1f5dfe3 to
61ffdce
Compare
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:
1.6.9→1.6.12Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Authlib: Cross-site request forging when using cache
CVE-2026-41425 / GHSA-jj8c-mmj3-mmgv
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 the GitHub Advisory Database (CC-BY 4.0).
Authlib OIDC Implicit/Hybrid Authorization Vulnerable to Open Redirect
CVE-2026-44681 / GHSA-r95x-qfjj-fjj2
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 the GitHub Advisory Database (CC-BY 4.0).
Authlib: Cross-site request forging when using cache
CVE-2026-41425 / GHSA-jj8c-mmj3-mmgv
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).
Authlib OIDC Implicit/Hybrid Authorization Vulnerable to Open Redirect
CVE-2026-44681 / GHSA-r95x-qfjj-fjj2
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).
Release Notes
authlib/authlib (authlib)
v1.6.12Compare Source
redirect_urionInvalidScopeErrorinOpenIDImplicitGrantandOpenIDHybridGrant.Full Changelog: authlib/authlib@v1.6.11...v1.6.12
v1.6.11Compare Source
Full Changelog: authlib/authlib@v1.6.10...v1.6.11
v1.6.10Compare Source
Full Changelog: authlib/authlib@v1.6.9...v1.6.10
redirect_urionUnsupportedResponseTypeError.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.