Server-Side Request Forgery [SSRF]
1. Введение:
2. Типичный уязвимый код:
<?php
/**
* Check if the 'url' GET variable is set
*
* Example request:
* http://localhost/?url=http://bobi.io/yakuhito.gif
*/
if (isset($_GET['url'])){
$url = $_GET['url'];
/**
* Send the request to the given
* $url.
*/
$image = fopen($url, 'rb');
/**
* Set the correct response headers.
*/
header("Content-Type: image/png");
/**
* Return the content of the image.
*/
fpassthru($image);
}
...3. Смягчение последствий:
3.1. Белые списки доменов HTTP-запросов:
3.2. Межсетевые экраны сетевого уровня:

4. Выводы:
Last updated