Repository navigation
Revoke every credential presented to the Core API logout endpoint - #72649
Merged
Merged
Conversation
potiuk
requested review from
bugraoz93,
choo121600,
ephraimbuddy,
henry3260,
jason810496,
pierrejeambrun,
rawwar and
shubhamraj-git
as code owners
September 7, 2026 16:08
potiuk
force-pushed
the
security/logout-revokes-bearer
branch
2 times, most recently
from
September 7, 2026 19:40
cda57df to
2f1bf21
Compare
logout() read only the _token cookie. A client authenticating with an Authorization: Bearer header -- the documented way to call the Core API -- therefore received a normal logout response while its token was never revoked, and that token stayed valid until it expired. The default lifetime is 24 hours. A copy of the token held by anyone else survived the holder's logout, so asking to be logged out did not end the session it was presented for. Logout uses collect_request_tokens() and revokes all of them, not just the precedence-selected one. It walks the same order get_user() authenticates by, so logout does not hard-code its own separate answer to what a request's credentials are. Revoking only the winner would leave any other credential the caller presented valid after they asked to be logged out, and which credential wins is a question about authentication that should not decide what a logout terminates. Revocation still happens before any redirect or cookie deletion, so an external auth-manager logout URL cannot skip it. The bearer tests fail against unpatched sources with 'assert False is True' -- the token is simply not revoked. Generated-by: Claude Code (Opus 5) Claude-Session: https://claude.ai/code/session_01XS3bodTDYYGrPmorhtLsjP
potiuk
force-pushed
the
security/logout-revokes-bearer
branch
from
September 8, 2026 17:22
2f1bf21 to
74039e0
Compare
Member
Author
|
Would love that one approved :) |
pierrejeambrun
approved these changes
Sep 10, 2026
1 task done
Contributor
Backport successfully created: v3-3-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
aws-airflow-bot
pushed a commit
to aws-mwaa/upstream-to-airflow
that referenced
this pull request
Sep 11, 2026
…endpoint (apache#72649) logout() read only the _token cookie. A client authenticating with an Authorization: Bearer header -- the documented way to call the Core API -- therefore received a normal logout response while its token was never revoked, and that token stayed valid until it expired. The default lifetime is 24 hours. A copy of the token held by anyone else survived the holder's logout, so asking to be logged out did not end the session it was presented for. Logout uses collect_request_tokens() and revokes all of them, not just the precedence-selected one. It walks the same order get_user() authenticates by, so logout does not hard-code its own separate answer to what a request's credentials are. Revoking only the winner would leave any other credential the caller presented valid after they asked to be logged out, and which credential wins is a question about authentication that should not decide what a logout terminates. Revocation still happens before any redirect or cookie deletion, so an external auth-manager logout URL cannot skip it. The bearer tests fail against unpatched sources with 'assert False is True' -- the token is simply not revoked. (cherry picked from commit 3f0a5d6) Co-authored-by: Jarek Potiuk <[email protected]> Generated-by: Claude Code (Opus 5) Claude-Session: https://claude.ai/code/session_01XS3bodTDYYGrPmorhtLsjP
vatsrahul1001
pushed a commit
that referenced
this pull request
Sep 11, 2026
…endpoint (#72649) (#72933) logout() read only the _token cookie. A client authenticating with an Authorization: Bearer header -- the documented way to call the Core API -- therefore received a normal logout response while its token was never revoked, and that token stayed valid until it expired. The default lifetime is 24 hours. A copy of the token held by anyone else survived the holder's logout, so asking to be logged out did not end the session it was presented for. Logout uses collect_request_tokens() and revokes all of them, not just the precedence-selected one. It walks the same order get_user() authenticates by, so logout does not hard-code its own separate answer to what a request's credentials are. Revoking only the winner would leave any other credential the caller presented valid after they asked to be logged out, and which credential wins is a question about authentication that should not decide what a logout terminates. Revocation still happens before any redirect or cookie deletion, so an external auth-manager logout URL cannot skip it. The bearer tests fail against unpatched sources with 'assert False is True' -- the token is simply not revoked. (cherry picked from commit 3f0a5d6) Generated-by: Claude Code (Opus 5) Claude-Session: https://claude.ai/code/session_01XS3bodTDYYGrPmorhtLsjP Co-authored-by: Jarek Potiuk <[email protected]>
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.
The Core API logout endpoint read only the
_tokencookie.A client authenticating with an
Authorization: Bearerheader — the documentedway to call the Core API — therefore received a normal logout response while its
token was never revoked. The token stayed valid until it expired; the default
lifetime is 24 hours and is configurable.
The practical effect is that a copy of the token held by anyone else survives the
holder's logout: asking to be logged out did not end the session it was presented
for.
The change
collect_request_tokens()and revokes all credentialspresented, not just the precedence-selected one. Revoking only the winner would
leave any other credential the caller presented valid after they asked to be
logged out — and which credential wins is a question about authentication
that should not decide what a logout terminates.
collect_request_tokens()walks the same orderget_user()authenticates by,so logout does not hard-code its own separate answer to what a request's
credentials are.
auth-manager logout URL cannot skip it.
get_user()itself is not touched by this PR. Its precedence — bearer → OAuthtoken → trusted-middleware cached user → cookie — is stated inline there as of
#72225, and
collect_request_tokens()follows that same credential order.Tests
Bearer-only logout, bearer plus cookie together, bearer before an external
redirect, and revocation when a user has been cached by
JWTRefreshMiddleware(so the trusted-user shortcut cannot cause logout to skip revocation).
Against unpatched sources the bearer tests fail with
assert False is True—the token is simply not revoked. The existing cookie tests are unchanged and
still pass, as do the 114 tests in
test_security.pyalongside this file's 18.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code following the guidelines