Skip to content

oauth_decode_state fixes - #20

Merged
d3vyce merged 2 commits into
mainfrom
19-oauth_decode_state-fixes
Jul 26, 2026
Merged

oauth_decode_state fixes#20
d3vyce merged 2 commits into
mainfrom
19-oauth_decode_state-fixes

Conversation

@d3vyce

@d3vyce d3vyce commented Jul 26, 2026

Copy link
Copy Markdown
Owner

No description provided.

d3vyce and others added 2 commits July 26, 2026 13:33
hmac.compare_digest("", "") is True, so a caller passing an empty stored
token (e.g. session.get("oauth_state", "") on a session miss) would let a
crafted state payload {"n": ""} pass CSRF verification, enabling login
CSRF. An empty expected token now always returns the fallback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Browsers strip tabs and newlines from URLs before parsing, so a
destination like "/\t/evil.com" passed the relative-path check but
resolved as the scheme-relative redirect "//evil.com" in the browser.
_destination_allowed now rejects any character <= 0x20 alongside
backslashes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@d3vyce d3vyce self-assigned this Jul 26, 2026
@d3vyce d3vyce linked an issue Jul 26, 2026 that may be closed by this pull request
@codecov-commenter

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@d3vyce
d3vyce merged commit d6efba4 into main Jul 26, 2026
7 checks passed
@d3vyce
d3vyce deleted the 19-oauth_decode_state-fixes branch July 26, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

oauth_decode_state fixes

2 participants