spring-projects / spring-projects/spring-security

Passkey Endpoints do not Honor .permitAll()

Open
#16,070 5 comments 0 reactions 1 assignee View on GitHub

@rwinch is already working on this.

Since Nov 14, 2024.

in: web status: feedback-provided type: bug
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

Describe the bug
The auth/z check on this line in the filter implementation for registering passkey credentials seems to prevent access to the webauthn endpoints even if .anyRequest().permitAll() is used.

Note that I'm using the RC version of Spring Security 6.4.0.

To Reproduce

  1. Add a Security Configuration using the following implementation:
@Configuration
class SecurityConfig {

    @Bean
    fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
        http
            .webAuthn{ it
                    .rpName("Example")
                    .rpId("example.localhost")
                    .allowedOrigins("https://example.localhost")
            }
            .authorizeRequests { it
                    .anyRequest()
                    .permitAll()
            }
            .csrf { it.disable() }
            
        return http.build()
    }
}
  1. Try to POST to /webauthn/register/options

Expected behavior
The request would return a 200 with the Registration Options.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.