Skip to content

SSF: Fix NPE in transmitter on RP-initiated logout without details (#51571) - #51572

Open
thomasdarimont wants to merge 1 commit into
keycloak:mainfrom
thomasdarimont:issue/gh51571-ssf-fix-npe-on-rp-logout
Open

SSF: Fix NPE in transmitter on RP-initiated logout without details (#51571)#51572
thomasdarimont wants to merge 1 commit into
keycloak:mainfrom
thomasdarimont:issue/gh51571-ssf-fix-npe-on-rp-logout

Conversation

@thomasdarimont

Copy link
Copy Markdown
Contributor

The non-browser RP-initiated logout path emits a success LOGOUT event without any details when no post_logout_redirect_uri is given, so Event.getDetails() is null. SecurityEventTokenMapper.shouldIgnoreLogout and SsfTransmitterEventListener.isUserSessionExpiration dereferenced the details map unconditionally, crashing the SSF event listener. Treat missing details as a real logout / non-expiration.

Fixes #51571

…eycloak#51571)

The non-browser RP-initiated logout path emits a success LOGOUT event
without any details when no post_logout_redirect_uri is given, so
Event.getDetails() is null. SecurityEventTokenMapper.shouldIgnoreLogout
and SsfTransmitterEventListener.isUserSessionExpiration dereferenced
the details map unconditionally, crashing the SSF event listener.
Treat missing details as a real logout / non-expiration.

Fixes keycloak#51571

Signed-off-by: Thomas Darimont <thomas.darimont@googlemail.com>
@thomasdarimont
thomasdarimont requested a review from a team as a code owner August 10, 2026 10:09
Copilot AI balanced review requested due to automatic review settings August 10, 2026 10:09
@thomasdarimont thomasdarimont added area/ssf Indicates an issue on Shared Signals Framework and removed team/core-iam labels Aug 10, 2026

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 SSF listener null dereferences when logout or session-deletion events have no details.

Changes:

  • Safely handles null event details.
  • Preserves real logout propagation.
  • Adds regression tests for affected paths.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
SsfTransmitterEventListener.java Handles missing session-deletion details.
SecurityEventTokenMapper.java Handles missing logout details.
SsfTransmitterEventListenerTest.java Tests null session-deletion details.
SecurityEventTokenMapperTest.java Tests logout filtering with null and populated details.

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

@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

@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.webauthn.WebAuthnPropertyTest#timeout

Keycloak CI - WebAuthn IT

org.openqa.selenium.WebDriverException: 
unknown error: unhandled inspector error: {"code":-32000,"message":"Node with given id does not belong to the document"}
  (Session info: chrome=150.0.7871.128)
Build info: version: '4.28.1', revision: '73f5ad48a2'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.17.0-1020-azure', java.version: '25.0.3'
...

Report flaky test

@thomasdarimont

Copy link
Copy Markdown
Contributor Author

I recommend to add this to a 26.7.2 patch release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ssf Indicates an issue on Shared Signals Framework flaky-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSF: Missing event details during user logout trigger NPE

2 participants