spring-projects / spring-projects/spring-security
Passkey Endpoints do not Honor .permitAll()
Open
@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
- 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()
}
}
- Try to POST to /webauthn/register/options
Expected behavior
The request would return a 200 with the Registration Options.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.