Default passkey pages fail with NullPointerException when CSRF is disabled
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- authentication, security
Direzione di ricerca
Inizia con WebAuthnConfigurer e DefaultWebAuthnRegistrationPageGeneratingFilter, dove l’issue individua le ricerche di un token CSRF nullo; leggi i test corrispondenti in WebAuthnConfigurerTests. Riproduci il problema con CSRF disabilitato e le passkey abilitate, poi verifica che /login e /webauthn/register vengano renderizzati senza un header CSRF né un campo nascosto quando non è presente alcun token.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Java
- Stelle
- 9.7k
- Fork
- 6.4k
- Merge medio
- 2g 2h
- PR unite (30g)
- 54
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di spring-projects/spring-security
-
Spring-security-7.1.xsd schema validates request-matcher incorrectlyForse già presa @suryakant-source l’ha presa 3 giorni fa. Apertastatus: waiting-for-triage type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
spring-projects/spring-security#19981 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
status: waiting-for-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
spring-projects/spring-security#19963 ·
I maintainer di solito rispondono entro 1 giorno
-
KerberosRestTemplate throws RestClientException when doExecute() returns nullForse già presa @Lyin-OTTF l’ha presa 6 giorni fa. Apertastatus: waiting-for-triage type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
spring-projects/spring-security#19935 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
`BearerTokenAuthenticationEntryPoint` emits `resource_metadata="null"` when the resource metadata parameter resolver returns `null`Forse già presa @ngocnhan-tran1996 l’ha presa 13 giorni fa. Apertastatus: waiting-for-triage type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
spring-projects/spring-security#19874 ·
I maintainer di solito rispondono entro 1 giorno
-
MapUserCredentialRepository leaves a stale owner index when a credential ID is reassignedForse già presa @adityaanikam l’ha presa 18 giorni fa. Apertastatus: waiting-for-triage type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
spring-projects/spring-security#19847 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di spring-projects/spring-security
Issue simili
-
protobuf
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
FasterXML/jackson-dataformats-binary#874 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
-
[Bug][Connector-V2][JDBC] Turkish locale bypasses the SQL set-operator and complex-clause guards, rewriting the user's queryForse già presa @SEPURI-SAI-KRISHNA l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 3 giorni
-
[Bug report] Lance REST catalog-level DropNamespace drops non-lakehouse catalogsForse già presa @nevzheng l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
I maintainer di solito rispondono entro 1 giorno
-
[BUG] jackson3 JacksonJsonpMapper(ObjectMapper) fails to deserialize `_source` with "Trailing token" errorForse già presa @junyeokk l’ha presa oggi. Apertabug untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
opensearch-project/opensearch-java#2236 ·
I maintainer di solito rispondono entro 1 giorno