chore(deps): update dependency authlib to v1.6.6 [security] #1034
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.5→==1.6.6Review
GitHub Vulnerability Alerts
CVE-2025-68158
I am writing to you from the Security Labs team at Snyk to report a security issue affecting Authlib, which we identified during a recent research project.
We have identified a vulnerability that can result in a 1-click Account Takeover in applications that use the Authlib library. (5.7 CVSS v3: AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N)
Description
Cache-backed state/request-token storage is not tied to the initiating user session, so CSRF is possible for any attacker that has a valid state (easily obtainable via an attacker-initiated authentication flow). When a cache is supplied to the OAuth client registry,
FrameworkIntegration.set_state_datawrites the entire state blob under_state_{app}_{state},andget_state_dataignores the caller’s session altogether. [1][2]authlib/integrations/base_client/framework_integration.py:12-41
Retrieval in authorize_access_token therefore succeeds for whichever browser presents that opaque value, and the token exchange proceeds with the attacker’s authorization code. [3]
authlib/integrations/flask_client/apps.py:57-76
This opens up the avenue for Login CSRF for apps that use the cache-backed storage. Depending on the dependent app’s implementation (whether it somehow links accounts in the case of a login CSRF), this could lead to account takeover.
[1] https://github.com/authlib/authlib/blob/260d04edee23d8470057ea659c16fb8a2c7b0dc2/authlib/integrations/flask_client/apps.py#L35
[2] https://github.com/authlib/authlib/blob/260d04edee23d8470057ea659c16fb8a2c7b0dc2/authlib/integrations/base_client/framework_integration.py#L33
[3] https://github.com/authlib/authlib/blob/260d04edee23d8470057ea659c16fb8a2c7b0dc2/authlib/integrations/flask_client/apps.py#L57
Proof of Concept
Let’s think of an app - AwesomeAuthlibApp. Let’s assume that the AwesomeAuthlibApp has internal logic that, when an already logged-in user performs a
callbackrequest, links the newly provided SSO identity to the already existing user that made the request.Then, an attacker can get account takeover inside the app by performing the following actions:
1. They start an SSO OAuth flow, but stop it right before making the callback call to AwesomeAuthlibApp;
2. The attacker tricks a logged-in user (via phishing, a drive-by attack, etc.) to perform a GET request with the attacker's state value and grant code to the AwesomeAuthlibApp callback. Because Authlib doesn’t check whether the state token is linked to the session performing the callback, the callback is processed, the grant code is sent to the provider, and the account linking takes place.
After the GET request is performed, the attacker's SSO account is linked with the victim's AwesomeAuthlibApp account permanently.
Suggested Fix
Per the OAuth RFC [4], the state should be tied to the user’s session to stop exactly such scenarios. One straightforward method of mitigating this issue is to keep storing the state in the session even when caching.
Another method would be to hash the session ID (or another per-user secret from the session) into the cache key. This way, the state will be stored inside the cache, but it is still linked to the session of the user that initiated the OAuth flow.
[4] https://www.rfc-editor.org/rfc/rfc6749#section-10.12
Authlib has 1-click Account Takeover vulnerability
CVE-2025-68158 / GHSA-fg6f-75jq-6523
More information
Details
I am writing to you from the Security Labs team at Snyk to report a security issue affecting Authlib, which we identified during a recent research project.
We have identified a vulnerability that can result in a 1-click Account Takeover in applications that use the Authlib library. (5.7 CVSS v3: AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N)
Description
Cache-backed state/request-token storage is not tied to the initiating user session, so CSRF is possible for any attacker that has a valid state (easily obtainable via an attacker-initiated authentication flow). When a cache is supplied to the OAuth client registry,
FrameworkIntegration.set_state_datawrites the entire state blob under_state_{app}_{state},andget_state_dataignores the caller’s session altogether. [1][2]authlib/integrations/base_client/framework_integration.py:12-41
Retrieval in authorize_access_token therefore succeeds for whichever browser presents that opaque value, and the token exchange proceeds with the attacker’s authorization code. [3]
authlib/integrations/flask_client/apps.py:57-76
This opens up the avenue for Login CSRF for apps that use the cache-backed storage. Depending on the dependent app’s implementation (whether it somehow links accounts in the case of a login CSRF), this could lead to account takeover.
[1] https://github.com/authlib/authlib/blob/260d04edee23d8470057ea659c16fb8a2c7b0dc2/authlib/integrations/flask_client/apps.py#L35
[2] https://github.com/authlib/authlib/blob/260d04edee23d8470057ea659c16fb8a2c7b0dc2/authlib/integrations/base_client/framework_integration.py#L33
[3] https://github.com/authlib/authlib/blob/260d04edee23d8470057ea659c16fb8a2c7b0dc2/authlib/integrations/flask_client/apps.py#L57
Proof of Concept
Let’s think of an app - AwesomeAuthlibApp. Let’s assume that the AwesomeAuthlibApp has internal logic that, when an already logged-in user performs a
callbackrequest, links the newly provided SSO identity to the already existing user that made the request.Then, an attacker can get account takeover inside the app by performing the following actions:
1. They start an SSO OAuth flow, but stop it right before making the callback call to AwesomeAuthlibApp;
2. The attacker tricks a logged-in user (via phishing, a drive-by attack, etc.) to perform a GET request with the attacker's state value and grant code to the AwesomeAuthlibApp callback. Because Authlib doesn’t check whether the state token is linked to the session performing the callback, the callback is processed, the grant code is sent to the provider, and the account linking takes place.
After the GET request is performed, the attacker's SSO account is linked with the victim's AwesomeAuthlibApp account permanently.
Suggested Fix
Per the OAuth RFC [4], the state should be tied to the user’s session to stop exactly such scenarios. One straightforward method of mitigating this issue is to keep storing the state in the session even when caching.
Another method would be to hash the session ID (or another per-user secret from the session) into the cache key. This way, the state will be stored inside the cache, but it is still linked to the session of the user that initiated the OAuth flow.
[4] https://www.rfc-editor.org/rfc/rfc6749#section-10.12
Severity
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Release Notes
authlib/authlib (Authlib)
v1.6.6Compare Source
Configuration
📅 Schedule: Branch creation - "" in timezone America/Montreal, Automerge - At any time (no schedule defined).
🚦 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.