JWT: expired and future tokens are accepted for 300 seconds with no leeway option

Aperta
#752 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à
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
c

Direzione di ricerca

Start with the JWT verification logic in src/security/jwt/jwt.c at lines 719–745, then trace how verification options are passed through the middleware. Add configurable leeway and boundary tests for -1, 0, 300, and 301 seconds; document the acceptance behavior and verify expired and future tokens follow the configured setting.

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

Descrizione

bug

Confirmed on dev at fd8cf045770459ebc0f6b6740f54dcd30a80ce6c.

JWT verification accepts expired exp tokens for an additional hard-coded 300 seconds and future nbf tokens up to 300 seconds early. There is no option to disable or reduce this leeway.

Source: https://github.com/c4punks/CWIST/blob/fd8cf045770459ebc0f6b6740f54dcd30a80ce6c/src/security/jwt/jwt.c#L719-L745

Reproduction with a correctly signed token whose exp is ten seconds in the past:

expired_seconds=10 verified=1

The middleware presents this as a valid token even though its expiry has passed. A five-minute acceptance window can be too long for short-lived credentials and is not documented as a mandatory security policy.

Make leeway configurable, default to zero unless compatibility requires otherwise, and document the exact acceptance behavior. Add boundary tests at -1, 0, 300, and 301 seconds.

Lingua principale
C
Stelle
16
Fork
7
Merge medio
4h 54m
PR unite (30g)
185

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 c4punks/CWIST

Tutte le issue di c4punks/CWIST

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.