<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Dns-Rebinding — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/dns-rebinding/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Wed, 03 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/dns-rebinding/feed.xml" rel="self" type="application/rss+xml"/><item><title>AVideo SSRF Vulnerability via HTTP Redirect and DNS Rebinding</title><link>https://feed.craftedsignal.io/briefs/2024-01-avideo-ssrf/</link><pubDate>Wed, 03 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-avideo-ssrf/</guid><description>AVideo is vulnerable to Server-Side Request Forgery (SSRF) due to improper validation of user-supplied URLs that does not prevent HTTP redirects, and DNS rebinding due to discarded resolved IP addresses.</description><content:encoded><![CDATA[<p>AVideo, version 29.0 and earlier, contains a Server-Side Request Forgery (SSRF) vulnerability due to insufficient validation of user-supplied URLs. Specifically, the <code>isSSRFSafeURL()</code> function, intended to prevent SSRF attacks, fails to account for HTTP redirects. This allows an attacker to bypass the intended security checks by providing a URL that initially appears safe but redirects to an internal resource, such as cloud metadata endpoints (169.254.169.254). Additionally, multiple callers of <code>isSSRFSafeURL()</code> discard the <code>$resolvedIP</code> parameter, creating a Time-of-Check Time-of-Use (TOCTOU) race condition exploitable via DNS rebinding. Attackers can manipulate DNS resolution to access internal services (127.0.0.1) that would otherwise be protected. Successful exploitation can lead to the disclosure of sensitive information, such as IAM credentials and internal service details.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker crafts a malicious URL pointing to a server they control.</li>
<li>The attacker&rsquo;s server responds with a 302 redirect to an internal resource (e.g., <code>http://169.254.169.254/latest/meta-data/</code>).</li>
<li>The attacker submits the initial malicious URL to a vulnerable AVideo endpoint (e.g., <code>/plugin/AI/receiveAsync.json.php</code>).</li>
<li>The <code>isSSRFSafeURL()</code> function validates the initial URL, which resolves to a public IP address, and incorrectly passes the check.</li>
<li>The <code>file_get_contents()</code> function, without proper redirect restrictions, follows the 302 redirect to the internal resource.</li>
<li>The request is made to the internal resource, bypassing the intended SSRF protections.</li>
<li>The internal resource (e.g., cloud metadata) responds with sensitive information.</li>
<li>The sensitive information (e.g., IAM credentials) is stored as a video thumbnail or image within the application, accessible to the attacker.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this SSRF vulnerability allows an authenticated attacker to force the AVideo server to make HTTP requests to arbitrary internal hosts. This includes cloud metadata endpoints (e.g., 169.254.169.254), potentially leading to the exfiltration of IAM credentials and instance identity information. Attackers can also access internal services on localhost (127.0.0.1) or the private network, such as databases, admin panels, and monitoring systems. The exfiltrated data can be retrieved through the application&rsquo;s public interface, increasing the severity of the impact.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Apply the suggested fix by routing affected files through <code>url_get_contents()</code> to safely handle redirects, as detailed in the advisory.</li>
<li>As an alternative to using <code>url_get_contents()</code>, implement an explicit no-redirect context when calling <code>file_get_contents()</code> to prevent automatic redirect following.</li>
<li>Update all callers of <code>isSSRFSafeURL()</code> to capture the <code>$resolvedIP</code> parameter and pass it to a DNS-pinning-aware fetch function using <code>CURLOPT_RESOLVE</code> to mitigate DNS rebinding attacks.</li>
<li>Monitor web server logs for requests containing internal IP addresses (169.254.169.254, 127.0.0.1) in the URL, as these may indicate SSRF attempts.</li>
<li>Deploy the Sigma rules in this brief to your SIEM and tune for your environment.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>ssrf</category><category>avideo</category><category>dns-rebinding</category></item></channel></rss>