Opening RTL causes CLN Application CSRF failure and misleading password prompt
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- authentication, security
Direzione di ricerca
Inizia dalla configurazione CSRF di Axios e dal punto di ingresso RootService.getAuthStatus(), quindi riproduci con RTL il flusso del browser con lo stesso hostname e porte diverse. Traccia come il cookie XSRF-TOKEN raggiunge /v1/auth/isauthenticated/ e come il suo errore viene convertito nello stato della password. Il lavoro è completato quando RTL non invalida più l’autenticazione di CLN Application e gli errori CSRF o di rete non vengono mostrati come errori della password.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
When CLN Application and Ride The Lightning (RTL) are served from the same hostname on different ports, opening RTL can cause CLN Application to fail its next authentication-status request with 403 Invalid CSRF token. Form tempered. CLN Application then displays its password dialog even when APP_SINGLE_SIGN_ON=true and the Umbrel session remains valid.
Browser cookies are scoped by hostname and path, not port. RTL writes a generic XSRF-TOKEN cookie at Path=/ on the shared hostname. Axios in CLN Application can consume that cookie for its XSRF header instead of the token CLN Application fetched from /v1/shared/csrf/.
Environment
- Umbrel / umbrelOS
- CLN Application image:
ghcr.io/elementsproject/cln-application:26.04 - CLN Application URL:
http://<host>:2103/cln APP_SINGLE_SIGN_ON=true- RTL URL:
http://<host>:3100/rtl - Reproduced with RTL v0.15.8
- Reviewed RTL v0.15.12 source: it still uses the generic
XSRF-TOKENcookie atPath=/ - Both apps use the same hostname and different ports
Steps to reproduce
- Log in to Umbrel normally.
- Open CLN Application and confirm it authenticates through SSO and displays node data without a password prompt.
- Open RTL on the same hostname in the same browser profile.
- Return to or reload CLN Application.
Actual behavior
CLN Application sends POST /v1/auth/isauthenticated/, receives HTTP 403, zeroes the displayed node data, and opens the password dialog.
Browser console:
Failed to load resource: the server responded with a status of 403 (Forbidden)
HTTP Request failed for post /auth/isauthenticated ... Invalid CSRF token. Form tempered.
Auth Status failed: Invalid CSRF token. Form tempered.
CLN Application server log at the same timestamps:
Invalid CSRF token. Form tempered.
This is misleading because the password is not wrong and SSO is still valid. lightningd remains healthy.
Confirmed recovery
Expiring only the XSRF-TOKEN cookie for the shared hostname at Path=/, then reloading CLN Application, immediately removes the password dialog and restores authenticated node data. Neither CLN Application nor lightningd needs to be restarted.
A direct HTTP test that shared only the _csrf cookie did not reproduce the failure. The real browser flow did reproduce it, which points specifically to Axios automatically reading RTL's visible XSRF-TOKEN cookie.
Relevant CLN Application behavior
CLN Application explicitly fetches a CSRF token from /v1/shared/csrf/ and assigns it to Axios's X-XSRF-TOKEN default header. However, Axios also has conventional XSRF-TOKEN cookie handling.
Separately, RootService.getAuthStatus() catches any request error and returns a state equivalent to unauthenticated with a valid password. Startup then opens the password modal, masking the underlying CSRF error.
Expected behavior
- Cookies created by another same-host application must not invalidate CLN Application requests.
- A CSRF/network error from
/auth/isauthenticatedmust not be presented as a password failure. - With
APP_SINGLE_SIGN_ON=true, this failure should provide a recoverable error state rather than a password prompt.
Suggested fixes
- Give CLN Application unique XSRF cookie/header names, or disable Axios automatic
XSRF-TOKENcookie consumption because CLN Application already fetches and sets its CSRF token explicitly. - Consider scoping the CLN CSRF cookie to an application-specific path where deployment routing permits it.
- Preserve the actual authentication-status error in
getAuthStatus()and do not convert every exception into the password-login state.
I can provide additional sanitized network traces if needed.
- Lingua principale
- TypeScript
- Stelle
- 52
- Fork
- 14
- Merge medio
- 3m
- PR unite (30g)
- 1
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna 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 ElementsProject/cln-application
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
ElementsProject/cln-application#166 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
ElementsProject/cln-application#120 ·
I maintainer di solito rispondono entro 1 giorno
-
Change Bookkeeper's sql queries to rpc calls with data filtering/groupingForse di nuovo libera @ShahanaFarooqui l’ha presa 490 giorni fa e non c’è nessuna pull request aperta. Aperta
ElementsProject/cln-application#110 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Add option for channel backup and recoveryForse di nuovo libera @ShahanaFarooqui l’ha presa 1242 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement
ElementsProject/cln-application#21 · 2 commenti · 2 reazioni · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Add option to use local mempool for block explorerForse di nuovo libera @ShahanaFarooqui l’ha presa 501 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement
ElementsProject/cln-application#3 · 2 reazioni · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ElementsProject/cln-application
Issue simili
-
docs(api): openapi.yaml still documents gif-tools optimize colors as 2-256 instead of 2, 4, 16, 256Apertaarea: backend documentation priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
snapotter-hq/SnapOtter#2919 ·
I maintainer di solito rispondono entro 1 giorno
-
accepted :+1: bug db/redis
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
beekeeper-studio/beekeeper-studio#4882 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
ready-for-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
konflux-ci/konflux-ui#1630 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
ahmedkhaleel2004/gitdiagram#233 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
simkimsia/netlify-axi#19 ·
I maintainer di solito rispondono entro 1 giorno