Skip to content

fix: restore X-Frame-Options: none on /session and /session_management#3922

Merged
fhanik merged 3 commits into
developfrom
pr/fix-singular-session-iframe
May 26, 2026
Merged

fix: restore X-Frame-Options: none on /session and /session_management#3922
fhanik merged 3 commits into
developfrom
pr/fix-singular-session-iframe

Conversation

@fhanik
Copy link
Copy Markdown
Contributor

@fhanik fhanik commented May 23, 2026

Green test run at https://bosh.ci.cloudfoundry.org/teams/uaa/pipelines/pull-requests/jobs/uaa-singular-tests/builds/259

fix: restore X-Frame-Options: none on /session and /session_management

The uaa-singular OIDC Session Management library implements logout detection by loading /session_management (and the legacy /session) inside a hidden cross-origin iframe called the opFrame. The embedded page posts the user's current session state back to the RP via window.postMessage. When the browser sees X-Frame-Options: DENY it refuses to render the iframe, so the postMessage handler never fires and the onLogout callback is never invoked — breaking silent logout for every application that integrates uaa-singular.

The regression was introduced by commit 9954dda ("Upgrade to Spring Boot 3.4.6"). The noSecurityFilters SecurityFilterChain, which covers the no-auth endpoints including /session and /session_management, previously called .frameOptions().disable() to suppress the header on those paths. During the Spring Boot 3.4 migration the call was rewritten as .frameOptions(withDefaults()), which resolves to DENY — the opposite of the intended behaviour.

The two new SessionControllerMockMvcTests assertions (header().doesNotExist("X-Frame-Options")) guard against this class of regression recurring.

fhanik added 2 commits May 23, 2026 08:04
The uaa-singular library embeds /session and /session_management in a
cross-origin hidden iframe (opFrame) to drive OIDC session management
via postMessage. When browsers see X-Frame-Options: DENY they refuse to
render the page, so the postMessage handler never runs and the onLogout
callback is never invoked.

Add two MockMvc tests that assert the header is absent on those
endpoints. They will fail until the Spring Boot 3.4.6 regression
(9954dda) is corrected.
…ints

During the Spring Boot 3.4.6 upgrade (9954dda) the noSecurityFilters
SecurityFilterChain had its explicit frameOptions().disable() mistakenly
replaced with frameOptions(withDefaults()), which defaults to DENY.

The /session and /session_management endpoints must be embeddable in
cross-origin iframes: the uaa-singular OIDC Session Management library
loads them inside a hidden opFrame and communicates the session state
back to the RP via postMessage. X-Frame-Options: DENY prevents the
browser from rendering the iframe, so the onLogout callback is never
invoked.

Restore the previous behaviour by passing AbstractHttpConfigurer::disable
(the correct Spring Security 6 equivalent of the old .disable() call).
duanemay
duanemay previously approved these changes May 24, 2026
@github-project-automation github-project-automation Bot moved this from Inbox to Pending Merge | Prioritized in Foundational Infrastructure Working Group May 24, 2026
@fhanik fhanik requested a review from strehle May 25, 2026 17:34
@fhanik fhanik self-assigned this May 25, 2026
@fhanik fhanik merged commit 43dafe7 into develop May 26, 2026
27 checks passed
@fhanik fhanik deleted the pr/fix-singular-session-iframe branch May 26, 2026 14:11
@github-project-automation github-project-automation Bot moved this from Pending Merge | Prioritized to Done in Foundational Infrastructure Working Group May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants