8000 Enforce the essential acr level when the flow finishes without a step-up by michalvavrik · Pull Request #53587 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Enforce the essential acr level when the flow finishes without a step-up - #53587

Merged
rmartinc merged 1 commit into
keycloak:mainfrom
michalvavrik:in-review/53157
Oct 26, 2026
Merged

rmartinc merged 1 commit into
keycloak:mainfrom
michalvavrik:in-review/53157

Conversation

Copilot AI balanced review requested due to automatic review settings October 6, 2026 10:07
@michalvavrik
michalvavrik requested review from a team as code owners October 6, 2026 10:07
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.

Copilot review overview

🟡 Changes recommended

Forced ACR enforcement remains bypassable for browser flows without a conditional LoA authenticator.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Enforces mandatory LoA checks when authentication finishes without executing a step-up condition, addressing CVE-2026-97176.

Changes:

  • Registers forced-LoA validation at top-level flow completion.
  • Adds protocol-specific OIDC and SAML error handling.
  • Adds regression tests and upgrade documentation.
File Description
testsuite/​.../​LevelOfAssuranceFlowSamlTest.java Adds SAML SSO regression tests.
tests/​.../​LevelOfAssuranceEssentialAcrTest.java Adds OIDC essential-ACR coverage.
services/​.../​OIDCLoginProtocol.java Maps LoA failures to the OIDC error.
services/​.../​AuthorizationEndpointBase.java Handles passive LoA failures.
services/​.../​DefaultAuthenticationFlow.java Registers final forced-LoA validation.
services/​.../​AcrNotFulfilledException.java Introduces a dedicated exception.
services/​.../​ConditionalLoaAuthenticator.java Uses the dedicated exception.
docs/​.../​changes-27_0_0.adoc Documents stricter enforcement.
core/​.../​OAuthErrorException.java Defines the new OIDC error constant.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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

Copilot review overview

🟡 Changes recommended

The new production exception source is missing the package-standard license header.

Review effort: Balanced
Findings: 1 High severity · 1 Low severity

Open (2)

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

Copilot review overview

🔵 Needs a closer look

Security-sensitive authentication-flow and protocol-error changes warrant final human validation.

Review effort: Balanced
Findings: 1 High severity

Open (1)
Resolved since last review (1)

@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.broker.KcSamlBrokerTest#loginInResponseToEmpty

Keycloak CI - FIPS IT (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.proxy.extractors.DefaultEntityExtractorFactory$3.extractEntity(DefaultEntityExtractorFactory.java:41)
	at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invokeSync(ClientInvoker.java:146)
	at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invoke(ClientInvoker.java:104)
...

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

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

@michalvavrik Thanks, I've added inline comment in the DefaultAuthenticationFlow (related to copilot review). WDYT?

@mposolda mposolda self-assigned this Oct 7, 2026
Copilot AI balanced review requested due to automatic review settings October 8, 2026 09: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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@michalvavrik
Copy link
Copy Markdown
Member Author

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

I can't say I am sorry 😀 but @mposolda if you want to be safe, please request review on your behalf.

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.

Copilot AI balanced review requested due to automatic review settings October 9, 2026 15:23
@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 @michalvavrik! There is conflict now. I have just the same doubt that copilot is saying, my feeling is we can always set the callback for LoA if the level is enforced. It doesn't matter the LoA condition is executed later or not (that depends on the workflow, maybe it's not done OK and, even present, it's not executed). WDYT?

For the rest I'm OK. I think that your tests cover a lot of scenarios. So I think that it's complete. Just fix the conflict in the note and this is OK to me.

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

@michalvavrik Thanks! Just a quick top-of-mind review, and rather implementation-wise suggestions. I think major concerns are brought up already by @mposolda and @rmartinc.

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

🔵 Needs a closer look

Security-sensitive flow changes need human validation, including resolution of premature enforcement before post-broker step-up.

1 open issue
1 resolved since last review

Review effort: Balanced

… step-up

closes: keycloak#53157

Signed-off-by: Michal Vavřík <dev@michalvavrik.net>
Copilot AI balanced review requested due to automatic review settings October 19, 2026 10: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

Security-sensitive changes spanning SSO, passive authentication, brokered login, registration, and credential reset require final human validation.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@michalvavrik
michalvavrik requested a review from rmartinc October 19, 2026 12:34
@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 @michalvavrik! LGTM!
@mposolda @mabartos Please re-review when you have time. Thanks too!

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

One more thing,maybe now we prefer to move the upgrading note to 26.8.x instead of 27.0.0?

@michalvavrik
10BC8 Copy link
Copy Markdown
Member Author

One more thing,maybe now we prefer to move the upgrading note to 26.8.x instead of 27.0.0?

that is what I had, but @mposolda and @mabartos preferred it the other way around; I don't know what is right, so I can't be helpful here. I can apply it if y'all agree though.

@rmartinc
Copy link
Copy Markdown
Contributor

@mposolda @mabartos Would you like to take a second look to this?

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

@michalvavrik @rmartinc @mabartos Thanks for the updates and review! LGTM

AFAIK on where the "Upgrading notes" are supposed to be documented. In upstream, it works like:

  • In main branch, it should go to the upcoming major/minor release. So right now to changes-27_0_0.adoc .
  • In the respective release* branch, it should be upcoming release. So for example changes-26_8_3.adoc for release/26.8 (the 26.8.2 not released yet, but that is going to be CVEB and payload for it from upstream changes like this one is already closed)

@mposolda
Copy link
Copy Markdown
Contributor

Leaving open in case that @mabartos also wants to review?
@rmartinc Feel free to merge whenever it is OK from core-authn team

@mabartos
Copy link
Copy Markdown
Member

@rmartinc @mposolda I'm already in the middle of reviewing that and checking last concerns.

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

@michalvavrik LGTM for fixing the issue, thanks! I've added a comment for a possible follow-up issue on the step-up logic.

@rmartinc
Copy link
Copy Markdown
Contributor

Thanks everybody!

@rmartinc
rmartinc merged commit 791b93e into keycloak:main Oct 26, 2026
98 checks passed
@rmartinc
Copy link
Copy Markdown
Contributor

@michalvavrik You can start working on the backports when you have time.

@michalvavrik
michalvavrik deleted the in-review/53157 branch October 26, 2026 13:02
michalvavrik added a commit to michalvavrik/keycloak that referenced this pull request Oct 26, 2026
…thout a step-up

closes: keycloak#53157
backports: keycloak#53587

Signed-off-by: Michal Vavřík <dev@michalvavrik.net>
@michalvavrik
Copy link
Copy Markdown
Member Author

rmartinc added a commit that referenced this pull request Nov 12, 2026
…thout a step-up (#54345)

closes: #53157
backports: #53587

Signed-off-by: Michal Vavřík <dev@michalvavrik.net>
Signed-off-by: Martin Bartoš <mabartos@redhat.com>
Signed-off-by: Ricardo Martin <rmartinc@redhat.com>
Co-authored-by: Martin Bartoš <mabartos@redhat.com>
Co-authored-by: Ricardo Martin <rmartinc@redhat.com>
rmartinc added a commit that referenced this pull request Nov 12, 2026
…thout a step-up (#54346)

closes: #53157
backports: #53587

Signed-off-by: Michal Vavřík <dev@michalvavrik.net>
Signed-off-by: Ricardo Martin <rmartinc@redhat.com>
Co-authored-by: Martin Bartoš <mabartos@redhat.com>
Co-authored-by: Ricardo Martin <rmartinc@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

5 participants

0