Skip to content

Apply SessionAuthenticationStrategy to WebAuthnAuthenticationFilter#19039

Open
hqqw2h-lgtm wants to merge 2 commits intospring-projects:mainfrom
hqqw2h-lgtm:gh-16685
Open

Apply SessionAuthenticationStrategy to WebAuthnAuthenticationFilter#19039
hqqw2h-lgtm wants to merge 2 commits intospring-projects:mainfrom
hqqw2h-lgtm:gh-16685

Conversation

@hqqw2h-lgtm
Copy link
Copy Markdown

Summary

Fix session concurrency control being bypassed during passkey (WebAuthn) authentication.

Root Cause: WebAuthnConfigurer did not apply the SessionAuthenticationStrategy to WebAuthnAuthenticationFilter. When maximumSessions(1) was configured, the constraint was enforced for form-based login but not for passkey login.

Fix: Retrieve the shared SessionAuthenticationStrategy and set it on WebAuthnAuthenticationFilter, following the same pattern used by AbstractAuthenticationFilterConfigurer and RememberMeConfigurer.

  • Added SessionAuthenticationStrategy wiring in WebAuthnConfigurer.configure()
  • Added test verifying the filter is properly configured when session management is enabled

Closes gh-16685

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 4, 2026
@therepanic
Copy link
Copy Markdown
Contributor

slop

WebAuthnConfigurer did not wire the shared SessionAuthenticationStrategy
into WebAuthnAuthenticationFilter, so session concurrency limits were
bypassed during passkey authentication.

Closes spring-projectsgh-16685

Signed-off-by: hanweiwei <duzielww@163.com>
@hqqw2h-lgtm
Copy link
Copy Markdown
Author

Thanks for the feedback. I've pushed a fix to address the issues: removed the accidentally committed temp file, corrected import ordering, and strengthened the test to verify the SessionAuthenticationStrategy is actually applied (using ReflectionTestUtils).

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

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logging in with passkeys bypasses maximum session restriction

4 participants