veza/docs/adr/ADR-004-pkce-oauth.md

969 B

ADR-004: PKCE pour le Flux OAuth (v0.902)

Date: 2026-03-02
Statut: Accepté (implémentation prévue v0.902)
Réf.: VEZA-SEC-003, OWASP A07


Contexte

Le flux OAuth Authorization Code actuel ne supporte pas PKCE (Proof Key for Code Exchange). Sur un client public (SPA), le code d'autorisation peut être intercepté lors de la redirection.

Décision

Implémenter PKCE (S256) dans le flux OAuth, cible v0.902 "Sentinel".

  • code_verifier : 128 bytes random, base64url
  • code_challenge : SHA-256 du verifier, base64url
  • code_challenge_method=S256 dans l'URL d'autorisation
  • Stockage du verifier en DB (oauth_states.code_verifier) ou Redis

Justification

  • Google, GitHub, Discord, Spotify supportent PKCE
  • Conformité OWASP A07 (Authentication)
  • Vulnérabilité ÉLEVÉE identifiée dans l'audit

Conséquences

  • OAuth plus sécurisé pour les SPA
  • Migration possible pour les bases existantes (nouvelle colonne)