Logout accepts GET requests

Aperta
#6,403 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
67/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
django, javascript, python

Direzione di ricerca

Read contentcuration/contentcuration/views/users.py and the logout action in contentcuration/contentcuration/frontend/shared/vuex/session/index.js; the issue gives the relevant entry points and expected behavior. Update backend and frontend tests to cover GET, POST with and without a CSRF token, direct logout() callers, and the sign-out flows. Done means GET is rejected, valid POST logs out, missing CSRF is rejected, and both app sign-out controls still work.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

DEV: backend DEV: frontend

Overview

/accounts/logout/ logs the user out on a GET request, which Django's CSRF protection doesn't check. Any page a Studio user visits can sign them out by loading that URL, for example as an image.

Complexity: Low
Target branch: hotfixes

Context
The Change
  • logout should accept only POST, with Django's CSRF check, and the frontend should call it with POST.
Acceptance Criteria
General
  • GET /en/accounts/logout/ returns 405 and the session stays active.
  • POST /en/accounts/logout/ with a valid CSRF token ends the session, and without one returns 403.
  • DeleteAccountView and new_user_redirect, which call logout() directly, still end the session as before.
  • "Sign out" in the app bar and the navigation drawer still signs the user out, including after confirming the unsaved-changes prompt.
Testing
  • Backend tests cover GET, POST with a CSRF token and POST without one.
  • A frontend test asserts the logout action sends a POST.

AI usage

I chose which audit findings belong in #6398 and set the access pattern. Claude Code found and reproduced this gap and drafted this issue.

Lingua principale
Python
Stelle
212
Fork
321
Merge medio
1g 7h
PR unite (30g)
14

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di learningequality/studio

Tutte le issue di learningequality/studio

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.