8000 Fix inverted return value in legacy KEYCLOAK_SESSION cookie comparison by MdTanwer · Pull Request #50147 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Fix inverted return value in legacy KEYCLOAK_SESSION cookie comparison - #50147

Merged
mposolda merged 2 commits into
keycloak:mainfrom
MdTanwer:fix/50124-oidc-session-cookie-return-value
Aug 17, 2026
Merged

mposolda merged 2 commits into
keycloak:mainfrom
MdTanwer:fix/50124-oidc-session-cookie-return-value

Conversation

@MdTanwer
Copy link
Copy Markdown
Contributor

The backwards-compatibility path in compareSessionIdWithSessionCookie() returned true when session IDs differed, breaking session fixation cleanup and browser logout for clients with old-format cookies.
Closes #50124.

The backwards-compatibility path in compareSessionIdWithSessionCookie()
returned true when 
8000
session IDs differed, breaking session fixation cleanup
and browser logout for clients with old-format cookies. Closes keycloak#50124.
@MdTanwer
MdTanwer marked this pull request as ready for review June 19, 2026 06:33
@MdTanwer
MdTanwer requested a review from a team as a code owner June 19, 2026 06:33
Copilot AI review requested due to automatic review settings June 19, 2026 06:33
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a logic bug in AuthenticationManager.compareSessionIdWithSessionCookie() where the legacy (old-format) KEYCLOAK_SESSION cookie comparison returned the inverted result, which could break session-fixation cleanup and browser logout behavior for clients still using old-format cookies.

Changes:

  • Corrected the legacy cookie path to return true only when the extracted legacy session id matches the provided sessionId.
  • Left the SHA-256 (new-format) cookie path unchanged.

@ahus1
ahus1 commented Jun 19, 2026
Copy link
Copy Markdown
Member

As of CONTRIBUTING.md, "new contributors may have at most 2 open pull requests at a time". Closing this one due to that.

@ahus1 ahus1 closed this Jun 19, 2026
@mposolda mposolda assigned mposolda and unassigned mposolda Aug 17, 2026
@mposolda mposolda reopened this Aug 17, 2026
@mposolda mposolda self-assigned this Aug 17, 2026
@mposolda mposolda left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MdTanwer Was able to re-open your PR, approving it now. Thanks!

@mposolda
mposolda merged commit dea20b7 into keycloak:main Aug 17, 2026
101 of 104 checks passed
@MdTanwer
MdTanwer deleted the fix/50124-oidc-session-cookie-return-value branch August 17, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OIDC: Inverted return value in compareSessionIdWithSessionCookie() backwards-compatibility path

4 participants

0