List routes answer 500 for a skip or page too large for the database

Ouverte
#1,001 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
Une demi-journée
Accessibilité débutants
72/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
postgresql, python
Domaine
api, backend

Piste de recherche

Start with the handlers for /api/v1/rollout-schedules/, /api/v1/users/, /api/v1/metrics/errors, /api/v1/feature-flags/, and /api/v1/audit-logs/, then inspect the shared Query validation used for skip and page. Reproduce the failures with the provided curl request, and check the rollout-schedules status error branch for the parameter-name collision. Done means every affected list route returns a 422 response identifying the invalid parameter, including the rollout-schedules error branch, instead of a generic 500.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

bug post-launch
  • Sent: GET /api/v1/rollout-schedules/?skip=9223372036854775808 (any role). The same for skip on
    GET /api/v1/users/ (superuser), GET /api/v1/metrics/errors and GET /api/v1/feature-flags/, and for page on
    GET /api/v1/audit-logs/ (the offset is (page - 1) * limit).
  • Comes back: 500 with the generic error body. The offset reaches the query, and PostgreSQL stores an offset in a
    64-bit integer, so anything from 2^63 up is refused. skip=9223372036854775807 answers 200.
  • Expected: 422 naming the parameter, for example an upper bound on skip and page (le= on the Query), the
    same on every list route.
  • Also on GET /api/v1/rollout-schedules/: the status filter parameter has the same name as the module the
    route's error branch uses for its status code, so that branch fails too (it still answers 500).
  • Reproduction (VIEWER): curl -H "Authorization: Bearer <VIEWER token>" 'http://localhost:8000/api/v1/rollout-schedules/?skip=9223372036854775808'

Found by API fuzzing (a local run), reproduced by hand.

Langage dominant
Python
Étoiles
0
Forks
4
Merge moyen
7 h 47 min
PR mergées (30 j)
427

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de Controlvar/controlvar

Toutes les issues de Controlvar/controlvar

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.