Descrizione
next-auth 4.2.0 through 4.24.15 contains an authentication bypass vulnerability in the withAuth middleware handleMiddleware function due to unbounded startsWith prefix checks. Unauthenticated attackers can request routes like /api/authors or /_next-admin to skip session checks and the authorized callback, reaching middleware-protected routes.
Tipo di vulnerabilità
CWE-187
Partial String Comparison
The product performs a string comparison that only examines a portion of the string before determining whether there is a match.
Impatto sui sistemi
| Ambito | Impatto |
| Integrità, Controllo degli accessi |
Alterare la logica di esecuzione, Aggirare i meccanismi di protezione |
Come si previene
Test
Thoroughly test the comparison scheme before deploying code into production. Perform positive testing as well as negative testing.
Tutte le 20 CVE di tipo CWE-187, con andamento e prevenzione