
Scanner sicuro e non intrusivo che rileva la vulnerabilità di scrittura fuori dai limiti FortiOS SSL VPN (CVE-2024-21762) confrontando le risposte HTTP POST normali e a blocchi.
| Campo | Valore |
|---|
| CVE | CVE-2024-21762 |
| Avviso | FG-IR-24-015 |
| CVSS | 9.8 (Critico) |
| CWE | CWE-787 (Scrittura fuori dai limiti) |
| CISA KEV | Sì - attivamente sfruttato in ambiente reale |
| Vettore d'Attacco | Rete (non autenticato) |
| Componente Affetto | sslvpnd (demone SSL VPN) |
Una vulnerabilità di scrittura fuori dai limiti nel FortiOS SSL VPN consente a un attaccante remoto non autenticato di eseguire codice arbitrario o comandi tramite richieste HTTP appositamente create. La vulnerabilità risiede nel parser di codifica di trasferimento chunked di HTTP all'interno di sslvpnd. Quando il demone riceve una richiesta POST con Transfer-Encoding: chunked, non riesce a convalidare correttamente le dimensioni dei chunk, causando una scrittura fuori dai limiti nell'heap.
| Ramo | Interessate | Risolte |
|---|---|---|
| FortiOS 7.4 | 7.4.0 - 7.4.2 | 7.4.3 |
| FortiOS 7.2 | 7.2.0 - 7.2.6 | 7.2.7 |
| FortiOS 7.0 | 7.0.0 - 7.0.13 | 7.0.14 |
| FortiOS 6.4 | 6.4.0 - 6.4.14 | 6.4.15 |
| FortiOS 6.2 | 6.2.0 - 6.2.15 | 6.2.16 |
| FortiOS 6.0 | Tutte le versioni | Migrare |
Lo script confronta la risposta del server a una normale richiesta POST con una richiesta POST con Transfer-Encoding: chunked allo stesso endpoint valido (/remote/logincheck).
Content-Length: Il server elabora la richiesta e restituisce una risposta HTTP (200 OK).Transfer-Encoding: chunked: Nelle versioni vulnerabili, sslvpnd non può gestire la codifica chunked e chiude la connessione senza rispondere (0 byte).Questo comportamento differenziale conferma la vulnerabilità senza attivare l'effettiva scrittura fuori dai limiti.
Normal POST --> HTTP/1.1 200 OK (N bytes)
Chunked POST --> Connection closed (0 bytes) <-- VULNERABLE
Normal POST --> HTTP/1.1 200 OK (N bytes)
Chunked POST --> HTTP/1.1 200 OK (N bytes) <-- PATCHED
python cve_2024_21762_safecheck.py <host> <port>
$ python cve_2024_21762_safecheck.py 10.0.0.1 8443
[*] Target: 10.0.0.1:8443
[*] CVE-2024-21762 - Out-of-Bounds Write in sslvpnd (CVSS 9.8)
[*] Method: Compare normal POST vs chunked POST response
[*] Test 1: Normal POST to /remote/logincheck
Response: HTTP/1.1 200 OK
Size: 722 bytes
[*] Test 2: Chunked POST to /remote/logincheck
Response: empty (connection closed by server)
============================================================
[!] VULNERABLE to CVE-2024-21762
Normal POST works but chunked TE causes connection
drop -> sslvpnd cannot handle chunked TE
Severity: CRITICAL (CVSS 9.8)
CISA KEV: Yes (actively exploited in the wild)
============================================================
| Risultato | Significato |
|---|---|
VULNERABLE | Il POST normale risponde, il POST chunked chiude la connessione |
PATCHED | Entrambe le richieste ricevono una risposta HTTP |
INCONCLUSIVE | Nessuna richiesta ha ottenuto risposta (rate limiting attivo, riprovare più tardi) |
/remote/logincheck. Se ottieni INCONCLUSIVE, attendi qualche minuto e riprova./remote/VULNCHECK come endpoint. Quel percorso potrebbe non restituire il 403 previsto su tutte le versioni FortiGate, portando a risultati inaffidabili. Questo script usa /remote/logincheck, che è un endpoint SSL VPN valido noto.