Logout accepts GET requests

Offen
#6,403 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
67/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Python
Sterne
212
Forks
321
Ø Merge
1 T. 7 Std.
Gemergte PRs (30 T.)
14

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus learningequality/studio

Alle Issues in learningequality/studio

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.