8000 Ignore UpdateUserLocaleAction to force a result by rmartinc · Pull Request #54250 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Ignore UpdateUserLocaleAction to force a result - #54250

Merged
ahus1 merged 1 commit into
keycloak:mainfrom
rmartinc:issue-54244
Oct 26, 2026
Merged

ahus1 merged 1 commit into
keycloak:mainfrom
rmartinc:issue-54244

Conversation

@rmartinc
@rmartinc rmartinc commented Oct 22, 2026 •
Copy link
Copy Markdown
Contributor

Closes #54244

The issue was that the UpdateUserLocaleAction did not set any result. The PR adds the ignore and also change the evaluation to default to failure instead of returning null (the most secure option I think). I have reviewed the other actions and I see all of them manage the result, but for example the UpdateEmail was doing the same in some scenarios. Fixed too. Let's see if copilot finds more actions that are not adding the result status in some paths (but now the evaluation will fail instead of silently returning early).

@rmartinc
rmartinc requested review from a team as code owners October 22, 2026 09:50
Copilot AI balanced review requested due to automatic review settings October 22, 2026 09:50
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 locale processing callback calls ignore(), which its request-processing context explicitly rejects with a runtime exception.

1 open issue
What changed in this PR

This PR addresses the required-action ordering flaw described in #54244, where updating a user’s locale could skip mandatory OTP enrollment.

Changes:

  • Explicitly skip locale and inapplicable email actions rather than leaving their status unset.
  • Treat unhandled required-action statuses as failures.
  • Add a regression test that places the locale action before OTP configuration.
File Description
testsuite/​integration-arquillian/​tests/​base/​src/​test/​java/​org/​keycloak/​testsuite/​actions/​RequiredActionPriorityTest.java Tests that OTP enrollment follows the locale action.
services/​src/​main/​java/​org/​keycloak/​services/​managers/​AuthenticationManager.java Fails closed for unhandled action statuses.
services/​src/​main/​java/​org/​keycloak/​authentication/​requiredactions/​UpdateUserLocaleAction.java Clears the pending locale action and adds explicit callback results.
services/​src/​main/​java/​org/​keycloak/​authentication/​requiredactions/​UpdateEmail.java Explicitly ignores read-only or inapplicable email updates.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 22, 2026 09:56
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.

🔵 Needs a closer look

The security-sensitive dispatcher change affects all required-action providers and warrants human validation, with direct unset-status regression coverage still missing.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Low severity Add regression test for unset challenge status rejection

services/​src/​main/​java/​org/​keycloak/​services/​managers/​AuthenticationManager.java:1399

The added locale regression test takes the IGNORE branch, so it would still pass if this unset-status fallback returned null again. Please add a regression test with a required-action provider whose requiredActionChallenge leaves the status unset, asserting that authentication is rejected and no authorization code is issued.

1 resolved since last review

Review effort: Balanced

@mabartos mabartos left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@rmartinc Thanks for the PR! I've just added one comment.

Btw. the signature of methods for the required actions might be improved, as we'd like to always mark the execution somehow. It means that at this moment, we need to add the missing context.XyAction()(ignore, challenge,...). It'd be nice to have some better method signatures that could always return some kind RequiredActionResult with the status + possible body. But it might be for the future. WDYT?

}
}
} else {
context.getUser().removeRequiredAction(UserModel.RequiredAction.UPDATE_EMAIL);
@mabartos mabartos Oct 22, 2026 •
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we really remove it here? What if the update email functionality is enabled afterwards? IMHO, we should just ignore it, and still have it recorded on the user, right? This is kind of behavioral change.

@rmartinc WDYT?

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.

Done!

Copilot AI balanced review requested due to automatic review settings October 26, 2026 08:32
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.

🔵 Needs a closer look

The MFA-bypass fix changes shared authentication failure handling and warrants human security review.

1 open issue

Review effort: Balanced

Coses keycloak#54244

Signed-off-by: rmartinc <rmartinc@redhat.com>
Copilot AI balanced review requested due to automatic review settings October 26, 2026 08:40
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.

🔵 Needs a closer look

The security-sensitive dispatcher change needs human validation of fail-closed behavior and compatibility with custom required-action providers.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@mabartos mabartos left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@rmartinc LGTM, thanks!

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.

[CVE-2026-114438] Update User Locale can bypass required OTP enrollment

4 participants

0