wordpress函数wp_http_validate_url畸形IP绕过验证SSRF漏洞

阿里云提示:wordpress /wp-includes/http.php文件中的wp_http_validate_url函数对输入IP验证不当,导致黑客可构造类似于012.10.10.10这样的畸形IP绕过验证,进行SSRF;
修复方法 http.php 540行
preg_match('#^(([1-9]?\d|1\d\d|25[0-5]|2[0-4]\d)\.){3}([1-9]?\d|1\d\d|25[0-5]|2[0-4]\d)$#', $host)
改成
preg_match('#^(([1-9]?\d|1\d\d|25[0-5]|2[0-4]\d|0+\d+)\.){3}([1-9]?\d|1\d\d|25[0-5]|2[0-4]\d)$#', $host)

Leave a Reply

Your email address will not be published. Required fields are marked *