8000 Enforce client minimum ACR for logins not started at the authorization endpoint by gaoyikeshuer · Pull Request #55461 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Enforce client minimum ACR for logins not started at the authorization endpoint - #55461

Merged
rmartinc merged 1 commit into
keycloak:mainfrom
gaoyikeshuer:cve-55382
Nov 26, 2026
Merged

rmartinc merged 1 commit into
keycloak:mainfrom
gaoyikeshuer:cve-55382

Conversation

@gaoyikeshuer
@gaoyikeshuer gaoyikeshuer commented Nov 23, 2026 •
Copy link
Copy Markdown
Contributor

after fix:

Screen.Recording.2026-11-23.at.14.30.59.mov

The client's minimum ACR was only checked when login started from the normal login page, so starting from the forgot password link skipped the second factor. now it is read from the client settings whenever it was not recorded.

Closes #55382

@gaoyikeshuer
gaoyikeshuer requested a review from a team as a code owner November 23, 2026 12:58
Copilot AI balanced review requested due to automatic review settings November 23, 2026 12:58
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

Shared ACR/LoA resolution changes require end-to-end validation across reset, action-token, and SSO flows, since integration tests were not run and regression coverage is limited.

No open issues 🎉

What changed in this PR

Addresses #55382 by applying client-configured authentication levels when a login session has no recorded requirement, preventing second-factor checks from being skipped when login starts from the forgot-password page.

Changes:

  • Fall back to the client’s minimum and default ACR settings when the requested authentication level is absent.
  • Add a regression test confirming that returning to login from a direct password-reset link requires OTP for a client with minimum ACR 2.
File Description
tests/​base/​src/​test/​java/​org/​keycloak/​tests/​forms/​LevelOfAssuranceEssentialAcrTest.java Adds an OTP user, minimum-ACR client, and regression test for the password-reset entry point.
services/​src/​main/​java/​org/​keycloak/​authentication/​authenticators/​util/​AcrStore.java Derives the requested authentication level from client configuration when the session note is missing.

Review effort: Balanced

@gaoyikeshuer gaoyikeshuer changed the title Fix second factor got skipped when login started from forgot password… Enforce client minimum ACR for logins not started at the authorization endpoint Nov 23, 2026
Copilot AI balanced review requested due to automatic review settings November 23, 2026 15:18
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 shared ACR security fix requires browser/runtime validation across reset-credentials, action-token continuations, and SSO, but the added regression covers only the reset-link-to-login path.

No open issues 🎉

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 @gaoyikeshuer! LGTM! Just a nit-pick in the test to finish the login and assert the acr is 2.

Copilot AI balanced review requested due to automatic review settings November 24, 2026 10:54
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 reset-email flow can still complete login below the client’s minimum ACR, and the fallback can trigger SAML step-up authentication despite its feature being disabled.

2 open issues

Review effort: Balanced

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

🔵 Needs a closer look

The security-sensitive ACR changes span action-token and SSO flows, but the new regression covers only reset-link-to-login behavior and runtime validation of the other continuations was unavailable.

No open issues 🎉

2 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.

@gaoyikeshuer Just a little change, I prefer to only disable saml if the profile is disabled.

Copilot AI balanced review requested due to automatic review settings November 26, 2026 10:35
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

SAML step-up uses the wrong mapping helpers during IdP-initiated SSO, which can ignore the client's configured minimum authentication context and allow the OTP subflow to be skipped.

1 open issue

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 26, 2026 12:03
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

A critical SAML step-up gap allows IdP-initiated login below the client’s minimum authentication level when the second-factor subflow is skipped, requiring enforcement of the client-config fallback and a regression test.

1 open issue
1 resolved since last review

Review effort: Balanced

@keycloak-github-bot
Copy link
Copy Markdown

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.adapter.servlet.SAMLServletAdapterTest#testPostSimpleLoginLogoutIdpInitiatedRedirectTo

Keycloak CI - FIPS IT (non-strict)

jakarta.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error
	at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.handleErrorStatus(ClientInvocation.java:250)
	at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.extractResult(ClientInvocation.java:216)
	at org.jboss.resteasy.client.jaxrs.internal.proxy.extractors.BodyEntityExtractor.extractEntity(BodyEntityExtractor.java:59)
	at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invokeSync(ClientInvoker.java:146)
...

Report flaky test

org.keycloak.testsuite.adapter.servlet.SAMLServletAdapterTest#disabledClientTest

Keycloak CI - FIPS IT (non-strict)

org.opentest4j.MultipleFailuresError: 
Multiple Failures (2 failures)
	jakarta.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error
	jakarta.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error
	at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:160)
...

Report flaky test

org.keycloak.testsuite.adapter.servlet.SAMLServletAdapterTest#idpInitiatedLoginTest

Keycloak CI - FIPS IT (non-strict)

org.openqa.selenium.TimeoutException: 
Expected condition failed: waiting for wrapped: text ('principal=bburke') to be present in text in element found by By.xpath: //body
(tried for 5 seconds with 500 milliseconds interval)
Build info: version: '4.46.0', revision: 'df5a634 df5a6341cbb5f8f06b836bd595752775627c80dc'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '7.0.0-1020-azure', java.version: '25.0.5.1'
...

Report flaky test

@keycloak-github-bot keycloak-github-bot Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unreported flaky test detected, please review

… page.

Closes keycloak#55382

Signed-off-by: Yike Gao <yikegao8@gmail.com>
Copilot AI balanced review requested due to automatic review settings November 26, 2026 13:48
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 shared authentication-assurance change needs human security review and runtime validation of action-token continuations and SSO reuse beyond the added reset-credentials-to-login regression test.

1 open issue

Review effort: Balanced

@gaoyikeshuer
gaoyikeshuer commented Nov 26, 2026 •
Copy link
Copy Markdown
Contributor Author

Hi @rmartinc I removed the SAML changes. the fallback now skips SAML clients completely, so SAML behaves as before. Could you re-review it? Thanks

@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 @gaoyikeshuer!

@rmartinc
rmartinc merged commit c965c68 into keycloak:main Nov 26, 2026
97 checks passed
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-133228] A client's minimum ACR is not applied when the login starts at the credential reset endpoint (Keycloak 26.8.2)

3 participants

0