[GHSA-fg6f-75jq-6523] Authlib has 1-click Account Takeover vulnerability#7191
Open
levpachmanov wants to merge 1 commit intolevpachmanov/advisory-improvement-7191from
Open
[GHSA-fg6f-75jq-6523] Authlib has 1-click Account Takeover vulnerability#7191levpachmanov wants to merge 1 commit intolevpachmanov/advisory-improvement-7191from
levpachmanov wants to merge 1 commit intolevpachmanov/advisory-improvement-7191from
Conversation
Collaborator
|
Hi there @lepture! A community member has suggested an improvement to your security advisory. If approved, this change will affect the global advisory listed at github.com/advisories. It will not affect the version listed in your project repository. This change will be reviewed by our Security Curation Team. If you have thoughts or feedback, please share them in a comment here! If this PR has already been closed, you can start a new community contribution for this advisory |
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.
Updates
Comments
This is not affecting version 0.15.5 - due to the reasons below:
in short - not relevant to this version:
The state is tied to the user's session
An attacker cannot supply a valid state from their own session to be used in the victim's session
The get_session_data method uses session.pop() which removes the state from the session, ensuring it's only used once
more detailed:
State is stored in request.session, which is tied to the user's session cookie
An attacker cannot access the victim's session (assuming proper session security)
If an attacker tricks a victim into visiting the callback with the attacker's state, get_session_data will return None (the victim's session doesn't have that state), and validation fails
This is different from the cache-backed vulnerability where state was stored globally and not bound to a user session.
The architecture differs from the vulnerable pattern described in the CVE:
Version 0.15.5 uses a simpler state management system:
set_session_data() and get_session_data() store data in the session directly using keys like {name}authlib{key}
Cache is only used for OAuth1 request tokens (not OAuth2 state), and even then it stores a session ID in the session and the actual token in cache (see authlib/integrations/flask_client/oauth_registry.py )
State management:
1.OAuth2 state is stored directly in session via set_session_data(request, 'state', state)
2.Retrieved via get_session_data(request, 'state') which pops it from session enforces one-time use.
3.The session key format includes the client name: dev_authlib_state
4.There is NO cache-backed state storage pattern (Cache is only used for OAuth1 tokens with session-bound keys.)