Default passkey pages fail with NullPointerException when CSRF is disabled
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- authentication, security
Línea de trabajo
Empieza con WebAuthnConfigurer y DefaultWebAuthnRegistrationPageGeneratingFilter, donde el issue identifica las búsquedas de un token CSRF nulo; lee las pruebas correspondientes en WebAuthnConfigurerTests. Reproduce el problema con CSRF desactivado y las passkeys activadas, y luego comprueba que /login y /webauthn/register se renderizan sin una cabecera CSRF ni un campo oculto cuando no hay ningún token.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
With passkeys enabled and CSRF protection disabled, the default login page and the default passkey registration page fail with a NullPointerException:
WebAuthnConfigurergivesDefaultLoginPageGeneratingFiltera header resolver that reads theCsrfTokenrequest attribute and callsgetHeaderName()on it without checking fornull.DefaultWebAuthnRegistrationPageGeneratingFilterdoes the same when it renders the CSRF header for its script and the hidden input in each passkey's delete form.
The other default pages (login, logout and one-time token) already leave the token out when there is none.
To Reproduce
http
.formLogin(Customizer.withDefaults())
.csrf(AbstractHttpConfigurer::disable)
.webAuthn((webAuthn) -> webAuthn.rpId("example.com"));
Then GET /login, or GET /webauthn/register as a signed-in user:
java.lang.NullPointerException: Cannot invoke "org.springframework.security.web.csrf.CsrfToken.getHeaderName()" because "csrfToken" is null
at org.springframework.security.config.annotation.web.configurers.WebAuthnConfigurer.lambda$configure$2(WebAuthnConfigurer.java:208)
java.lang.NullPointerException: Cannot invoke "org.springframework.security.web.csrf.CsrfToken.getHeaderName()" because "csrfToken" is null
at org.springframework.security.web.webauthn.registration.DefaultWebAuthnRegistrationPageGeneratingFilter.renderCsrfHeader(DefaultWebAuthnRegistrationPageGeneratingFilter.java:130)
at org.springframework.security.web.webauthn.registration.DefaultWebAuthnRegistrationPageGeneratingFilter.doFilterInternal(DefaultWebAuthnRegistrationPageGeneratingFilter.java:88)
This affects 7.0.x, 7.1.x and main.
Expected behavior
Both pages render without a CSRF header or hidden input, as the other default pages do.
Sample
The configuration above is the whole reproduction; the pull request that fixes this adds it as a test in WebAuthnConfigurerTests.
- Lenguaje dominante
- Java
- Estrellas
- 9.7k
- Forks
- 6.4k
- Merge medio
- 1 d 22 h
- PR fusionados (30 d)
- 49
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de spring-projects/spring-security
-
status: waiting-for-triage type: enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
spring-projects/spring-security#19995 ·
Los mantenedores suelen responder en 1 día
-
Spring-security-7.1.xsd schema validates request-matcher incorrectlyPosiblemente ocupada @suryakant-source la tomó hace 4 días. Abiertostatus: waiting-for-triage type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
spring-projects/spring-security#19981 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
status: waiting-for-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
spring-projects/spring-security#19963 ·
Los mantenedores suelen responder en 1 día
-
KerberosRestTemplate throws RestClientException when doExecute() returns nullPosiblemente ocupada @Lyin-OTTF la tomó hace 7 días. Abiertostatus: waiting-for-triage type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
spring-projects/spring-security#19935 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
`BearerTokenAuthenticationEntryPoint` emits `resource_metadata="null"` when the resource metadata parameter resolver returns `null`Posiblemente ocupada @ngocnhan-tran1996 la tomó hace 14 días. Abiertostatus: waiting-for-triage type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
spring-projects/spring-security#19874 ·
Los mantenedores suelen responder en 1 día
Todos los issues de spring-projects/spring-security
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
strimzi/strimzi-kafka-operator#13328 · 1 comentario · 3 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
GoogleContainerTools/jib#4538 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
OpenLiberty/ci.maven#2137 ·
Los mantenedores suelen responder en 1 día
-
Payer adjustment can exceed the balance left after copay and deductible, so claim payments add up to more than the chargePosiblemente ocupada @DG47 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
synthetichealth/synthea#1772 ·
Los mantenedores suelen responder en 13 días
-
bug dependencies
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100