PHP SSRF
Last updated
Learn & practice AWS Hacking: Learn & practice GCP Hacking:
Some function such as file_get_contents(), fopen(), file(), md5_file() accept URLs as input that they will follow making possible SSRF vulnerabilities if the use can control the data:
As , even the Wordpress function wp_safe_remote_get
is vulnerable to DNS rebinding, making it potentially vulnerable to SSRF attacks. The main validation it calls is wp_http_validate_url, which checks that the protocol is http://
or https://
and that the port is one of 80, 443, and 8080, but it's vulnerable to DNS rebinding.
Other vulnerable functions according to the post are:
wp_safe_remote_request()
wp_safe_remote_post()
wp_safe_remote_head()
WP_REST_URL_Details_Controller::get_remote_url()
download_url()
wp_remote_fopen()
WP_oEmbed::discover()
Moreover, in some cases it might be even possible to send arbitrary headers via CRLF "vulnerabilities" in the previous functions:
Note that these function might have other methods to set arbitrary headers in requests, like:
For more info about that CRLF vuln, check this bug
Learn & practice AWS Hacking: Learn & practice GCP Hacking:
Check the !
Join the 💬 or the or follow us on Twitter 🐦 .
Share hacking tricks by submitting PRs to the and github repos.