`/api/sync/` accepts malformed changes and rev cursors
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Read contentcuration/contentcuration/viewsets/sync/endpoint.py and contentcuration/contentcuration/models.py, then follow the DRF serializer strategy in issue #6387. Add regression tests for each malformed input listed in the Context; done means malformed changes appear in disallowed, malformed bodies and cursors return 400, and valid changes in the same batch are still accepted. The issue states that it is not open for contribution.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Overview
/api/sync/ passes the changes and rev cursors in the request body to the database without validating them. A body that isn't a JSON object, a change with a missing or unknown field, or a rev of the wrong type raises an exception and the request returns 500. Any logged-in user can send these.
Complexity: Medium
Target branch: hotfixes
Context
All inputs below were reproduced:
SyncView.handle_changesandChange._create_from_changefail on:- a body that is a JSON list
changesofnullor5- a change missing
type, withtable: "nope", or withtype: 999._create_from_changeraisesTypeErrorfor the last two, which DRF doesn't convert. rev: "abc"orrev: 2**40- a change containing a
created_by_id,session_key,appliedorunpublishablekey channel_id: [1], or a channel create change with a 40-characterchannel_id
get_channel_revsandreturn_changesfail onchannel_revs: ["a"],channel_revs: {"<id>": "abc"}or{"<id>": {}},user_rev: "abc", andunapplied_revs: ["abc"]or5.
The Change
- The sync request body, each change in it, and the rev cursors should be validated with DRF serializers, following the strategy in #6387.
- A malformed change should be rejected on its own, in the response's
disallowedlist with its errors, so one bad change doesn't block the rest of the batch. - A malformed top-level body or rev cursor should return 400.
Acceptance Criteria
General
- Every input in Context either returns 400 or is listed in
disallowed, instead of returning 500. - Valid changes sent in the same batch as a malformed change are still accepted.
Testing
- Each input in Context has a regression test.
AI usage
I scoped the audit and chose the validation strategy in #6387. Claude Code found and reproduced these failures and drafted this issue.
- Lenguaje dominante
- JavaScript
- Estrellas
- 214
- Forks
- 327
- Merge medio
- 17 h 5 min
- PR fusionados (30 d)
- 25
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de learningequality/studio
-
Community library status changes don't update `date_updated`Posiblemente ocupada @ArpitaSamanta10 la tomó hace 14 días. Abiertocommunity-contribution-in-progress DEV: backend good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
learningequality/studio#6414 · 8 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Activation key can activate a different account whose email differs only in casePosiblemente ocupada @Madhu-priya123 la tomó hace 5 días. AbiertoDEV: backend
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
learningequality/studio#6410 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
DEV: backend
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
learningequality/studio#6409 ·
Los mantenedores suelen responder en 1 día
-
DEV: backend
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
learningequality/studio#6407 ·
Los mantenedores suelen responder en 1 día
-
Stripe webhook accepts events when no webhook secret is configuredPosiblemente ocupada @adibmbrk la tomó hace 14 días. Abiertocommunity-contribution-in-progress DEV: backend good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
learningequality/studio#6404 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de learningequality/studio
Issues similares
-
[bug] 提瓦特记事本原石检测框宽度较窄Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
babalae/bettergi-scripts-list#3905 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Bug] "Configure Colota" opens Colota with "Invalid configuration: No configuration data in URL"Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 87/100
dedicatedcode/reitti#1445 ·
Los mantenedores suelen responder en 1 día
-
New tool: Uncle DeskPosiblemente ocupada @github-actions la tomó hoy. Abiertosubmission triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
kausalflow/tools#384 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Add spaced repetition schedulingAbiertogood first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
-
Fuzz: css syntax bug foundAbiertoarea: css
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día