Key the application notice per-user limit on the canonical user id

Aperta
#553 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
Mezza giornata
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
postgresql, typescript

Direzione di ricerca

Start with the applicationNoticeUserLimiter key generator in src/middleware/applicationNoticeRateLimit.ts, where the raw req.body.userId is used as the bucket key. Compare it with the user lookup that resolves the canonical user.id to see where case normalization fits. Done when case variants of one UUID share a bucket and the limiter store choice is documented or made configurable for multi-instance deployments.

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

Descrizione

P1 security v0.23

Problem

applicationNoticeUserLimiter in src/middleware/applicationNoticeRateLimit.ts keys on the raw req.body.userId. z.uuid() accepts upper-case UUIDs and the Postgres lookup is case-insensitive, so case variants of one id get separate buckets, up to the per-client cap. Both notice limiters use the in-memory store, so each additional API instance multiplies the limits.

Fix

  • key on userId.toLowerCase(), or on the resolved user.id after lookup
  • use the shared rate-limit store when more than one instance runs
Lingua principale
TypeScript
Stelle
2
Fork
2
Merge medio
11h 40m
PR unite (30g)
104

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 fells-code/seamless-auth-api

Tutte le issue di fells-code/seamless-auth-api

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.