Skip to content

Reject in-progress login flow actions for disabled users - #55465

Open
vaceksimon wants to merge 5 commits into
keycloak:mainfrom
vaceksimon:55376-Consent-completion-can-issue-tokens-after-user-is-disabled
Open

vaceksimon wants to merge 5 commits into
keycloak:mainfrom
vaceksimon:55376-Consent-completion-can-issue-tokens-after-user-is-disabled

Conversation

@vaceksimon

Copy link
Copy Markdown
Contributor

Closes: #55376

@vaceksimon
vaceksimon requested a review from a team as a code owner November 23, 2026 16:34
Copilot AI balanced review requested due to automatic review settings November 23, 2026 16:34

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.

🟡 Changes recommended

The new check blocks logout confirmation for users disabled while the confirmation page is open, leaving their sessions active unless LOGGING_OUT sessions are exempted.

1 open issue
What changed in this PR

This PR addresses #55376 by rejecting pending login actions when the authenticated user has been disabled, including consent completion.

Changes:

  • Adds an enabled-user check during authentication-session verification.
  • Adds a consent regression test and strengthens the required-action test to verify that the password remains unchanged.
File Description
tests/​base/​src/​test/​java/​org/​keycloak/​tests/​forms/​LoginTest.java Tests rejection of consent and password updates after account disabling.
services/​src/​main/​java/​org/​keycloak/​services/​resources/​SessionCodeChecks.java Rejects resolved authentication sessions associated with disabled users.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 23, 2026 17: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.

🟡 Changes recommended

The change bypasses the disabled-client logout exemption, causing logout confirmation to fail and leaving the user session active.

1 open issue
1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 23, 2026 17:55

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.

🟢 Approval recommended

No active review issues were identified for the changes blocking pending login actions after a user is disabled.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@rmartinc rmartinc 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.

Thanks @vaceksimon! LGTM! Just add the same test but disabling the client before the accepting the consents.

}

@Test
public void disabledUserReceivesTokensViaConsentCompletion() {

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.

Just add the same test for the disabled client and it's OK to me.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@rmartinc added the test and rebased on main

Closes: keycloak#55376

Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>
Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>
Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>
Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>
Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>
@vaceksimon
vaceksimon force-pushed the 55376-Consent-completion-can-issue-tokens-after-user-is-disabled branch from 22b74d8 to ae7e7f0 Compare November 24, 2026 12:25
Copilot AI balanced review requested due to automatic review settings November 24, 2026 12:25

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.

🟢 Approval recommended

No active review issues are reported for the changes rejecting pending login actions for disabled users or clients.

No open issues 🎉

Review effort: Balanced

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.

[CVE-2026-133220] Consent completion can issue tokens after user is disabled

3 participants