<?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>Loopback — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/loopback/</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>Tue, 02 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/loopback/feed.xml" rel="self" type="application/rss+xml"/><item><title>link-preview-js vulnerable to IPv6 and internal loopback attacks</title><link>https://feed.craftedsignal.io/briefs/2024-01-link-preview-js-loopback/</link><pubDate>Tue, 02 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-link-preview-js-loopback/</guid><description>link-preview-js versions 4.0.0 and earlier are vulnerable to IPv6 and internal loopback attacks, allowing potential internal data leaks by resolving addresses to internal IPs; patched in version 4.0.1.</description><content:encoded><![CDATA[<p>The <code>link-preview-js</code> library, versions 4.0.0 and earlier, is susceptible to IPv6 loopback and internal IP address resolution attacks. This vulnerability arises because the library lacks proper validation for IPv6 loopback addresses and fails to adequately prevent DNS resolution to internal IP addresses. An attacker could exploit this to potentially leak internal data by causing the library to fetch content from internal services. Version 4.0.1 addresses this vulnerability by tightening the regex used for validation for IPv6 addresses and prohibiting <code>.internal</code>, <code>.local</code>, <code>.nip.io</code> and <code>.sslip.io</code> addresses. Users are strongly encouraged to use the <code>resolveDNSHost</code> option to perform DNS resolution before fetching content.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker crafts a URL that resolves to an internal IP address or an IPv6 loopback address.</li>
<li>The attacker provides the malicious URL to an application using the vulnerable <code>link-preview-js</code> library.</li>
<li>The <code>link-preview-js</code> library fetches the URL to generate a preview, without proper validation of the resolved IP address.</li>
<li>The library resolves the hostname, potentially using a DNS server controlled by the attacker or vulnerable to DNS poisoning.</li>
<li>The DNS resolution returns an internal IP address (e.g., 127.0.0.1, ::1, 192.168.x.x, 10.x.x.x, 172.16.x.x).</li>
<li>The library connects to the internal IP address, potentially accessing internal services or resources.</li>
<li>The application using <code>link-preview-js</code> processes the response from the internal service.</li>
<li>Sensitive internal data is leaked as part of the link preview generation process.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability could lead to the exposure of sensitive internal data. An attacker could potentially gain access to internal services, configuration files, or other resources that are not intended for public access. The specific impact depends on the nature of the internal services and data exposed. This vulnerability affects applications using <code>link-preview-js</code> version 4.0.0 or earlier, before the fix in version 4.0.1.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade <code>link-preview-js</code> to version 4.0.1 or later to address the vulnerability.</li>
<li>Implement additional validation of URLs and IP addresses before passing them to <code>link-preview-js</code>.</li>
<li>Use the <code>resolveDNSHost</code> option to do DNS resolution before fetching content as suggested in the advisory.</li>
<li>Monitor network connections for outbound requests to internal IP address ranges originating from processes using <code>link-preview-js</code>. Deploy the <code>Detect Outbound Connection to Internal IP Range</code> Sigma rule to identify potential exploitation.</li>
<li>Implement the <code>Detect DNS queries for internal TLDs</code> Sigma rule to identify DNS queries for internal domains such as <code>.internal</code>, <code>.local</code>, <code>.nip.io</code> and <code>.sslip.io</code>.</li>
<li>Apply network segmentation and access controls to limit the exposure of internal services.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>link-preview-js</category><category>loopback</category><category>ipv6</category><category>dns</category><category>internal-ip</category></item></channel></rss>