Account and settings views crash on malformed request bodies
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
- 56/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- api, authentication, backend
Direzione di ricerca
Start with the listed view entry points in contentcuration/views/users.py, settings.py, admin.py, and base.py, then read the serializer strategy in issue #6387 and the related forms in contentcuration/forms.py. Add regression coverage for each listed malformed input and confirm each returns 400 naming the invalid or missing field. Verify that well formed requests keep their existing status codes and response bodies.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Overview
The account and settings views parse the request body with json.loads(request.body) and read fields by key without checking the body's shape. A body that isn't valid JSON, isn't a JSON object, is missing a field, or has a field of the wrong type raises an exception, and the request returns 500. Most of these views are reachable without logging in: login, registration, password reset and request activation link.
Complexity: Medium
Target branch: hotfixes
Context
All sites below fail with the inputs shown, and each input was reproduced:
login: body{,[1], missingusername,{"username": 5}.UserRegistrationView: body{or[1]. Its form parsespolicieswithjson.loads, so"policies": "{"also fails.UserPasswordResetViewandUserPasswordResetConfirmView: body{or[1].request_activation_link: body{, missingemail.PostFormMixin.post, used by change password, update full name, issues, request storage, delete account and policies update: body{or[1].PolicyAcceptFormalso fails on apolicyof"{","[1]"or"\"x\"".send_custom_email: body{, or{}, which re-raises theKeyErrorasObjectDoesNotExist.set_language: body{,[],{"next": 5},{"language": 5}.
The Change
- Each view in Context should validate its request body with a DRF serializer, following the strategy in #6387, and return 400 for any malformed body.
- Well-formed requests should keep their current status codes and response bodies, because the frontend depends on them.
Acceptance Criteria
General
- Every input listed in Context returns 400 instead of 500.
- Each 400 response names the invalid or missing field.
- Well-formed requests to each view return the same status code and body as before.
Testing
- Each view has a regression test that sends a malformed body and asserts 400.
AI usage
I scoped the audit and chose the validation strategy in #6387. Claude Code found and reproduced these failures and drafted this issue.
- Lingua principale
- Python
- Stelle
- 212
- Fork
- 321
- Merge medio
- 1g 7h
- PR unite (30g)
- 14
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun 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 learningequality/studio
-
Community library status changes don't update `date_updated`Forse già presa @ArpitaSamanta10 l’ha presa oggi. Apertacommunity-contribution-in-progress DEV: backend good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
learningequality/studio#6414 · 8 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
DEV: backend
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
learningequality/studio#6410 ·
I maintainer di solito rispondono entro 1 giorno
-
DEV: backend
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
learningequality/studio#6409 ·
I maintainer di solito rispondono entro 1 giorno
-
DEV: backend
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
learningequality/studio#6407 ·
I maintainer di solito rispondono entro 1 giorno
-
Stripe webhook accepts events when no webhook secret is configuredForse già presa @adibmbrk l’ha presa oggi. Apertacommunity-contribution-in-progress DEV: backend good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
learningequality/studio#6404 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di learningequality/studio
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
canonical/paas-charm#407 · 1 commento ·
I maintainer di solito rispondono entro 5 giorni
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
FAIRmat-NFDI/pynxtools-spm#136 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement tooling
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
`read_nexus` entry point points to a function that no longer existsForse già presa @RubelMozumder l’ha presa oggi. Apertaannotator bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
FAIRmat-NFDI/pynxtools#876 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: HTTP 499 (Client Closed Request) is classified as a non-retryable format_error, so a mid-flight abort fails the turn over instead of retryingForse già presa @yipinghuang1991 l’ha presa oggi. Apertacomp/agent P2 type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
NousResearch/hermes-agent#156837 ·
I maintainer di solito rispondono entro 1 giorno