<?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>Go/Github.com/Gotd/Td (&lt; 0.145.1) - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/go/github.com/gotd/td--0.145.1/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Tue, 28 Jul 2026 22:17:12 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/go/github.com/gotd/td--0.145.1/feed.xml" rel="self" type="application/rss+xml"/><item><title>td Library Denial of Service via Unbounded Memory Allocation</title><link>https://feed.craftedsignal.io/briefs/2026-07-td-dos-unbounded-memory/</link><pubDate>Tue, 28 Jul 2026 22:17:12 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-07-td-dos-unbounded-memory/</guid><description>A denial-of-service vulnerability exists in the `go/github.com/gotd/td` library versions prior to 0.145.1. A remote, unauthenticated attacker can exploit this by sending a crafted unencrypted MTProto packet during the handshake. This packet declares a large `dataLen` value, forcing the application to allocate an excessive amount of memory, potentially leading to out-of-memory (OOM) termination and denial of service due to unbounded memory allocation before length validation.</description><content:encoded><![CDATA[<p>A high-severity denial-of-service vulnerability, tracked as CVE-2026-54638, affects the <code>go/github.com/gotd/td</code> library versions prior to 0.145.1. This flaw stems from an unbounded memory allocation in the <code>(*proto.UnencryptedMessage).Decode</code> function. A remote, unauthenticated attacker can exploit this by sending a specially crafted unencrypted MTProto packet during the initial handshake phase. The packet includes a manipulated 32-bit <code>dataLen</code> field that declares a multi-gigabyte payload. Critically, the vulnerable function attempts to allocate a buffer of the declared size <em>before</em> validating that the actual incoming data stream contains the specified number of bytes. This premature allocation of excessive memory can lead to significant CPU and garbage collection pressure, and ultimately, Out-Of-Memory (OOM) termination, rendering the affected application unavailable. There is no evidence of memory corruption or code execution associated with this vulnerability.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>A remote, unauthenticated attacker initiates communication with a service using the <code>go/github.com/gotd/td</code> library, targeting the MTProto handshake path.</li>
<li>The attacker crafts an unencrypted MTProto packet containing a manipulated 32-bit <code>dataLen</code> field, declaring an arbitrarily large payload size (e.g., <code>0x70000000</code>, approximately 1.75 GB).</li>
<li>The crafted packet is sent to the vulnerable application.</li>
<li>The <code>(*proto.UnencryptedMessage).Decode</code> function receives the packet.</li>
<li>Before validating if the incoming buffer actually contains the declared <code>dataLen</code> number of bytes, the function attempts to allocate a buffer of that size using <code>make([]byte, dataLen)</code>.</li>
<li>This forced allocation of a multi-gigabyte buffer consumes an excessive amount of system memory.</li>
<li>The application experiences high CPU and garbage collection (GC) pressure due to the memory allocation attempt.</li>
<li>The system runs out of memory, causing the application to crash or terminate (Out-Of-Memory), resulting in a denial-of-service condition.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>The primary impact of CVE-2026-54638 is a denial-of-service against applications using the vulnerable <code>go/github.com/gotd/td</code> library. Successful exploitation by a remote, unauthenticated attacker will cause excessive memory allocation, leading to significant CPU and garbage collection overhead, and potentially an Out-Of-Memory (OOM) termination of the application. This renders the service unavailable to legitimate users. The vulnerability specifically targets system availability and does not lead to memory corruption, out-of-bounds access, or remote code execution.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade the <code>go/github.com/gotd/td</code> library to version 0.145.1 or later to patch CVE-2026-54638.</li>
<li>Ensure that all applications using the <code>go/github.com/gotd/td</code> package are updated to a non-vulnerable version to mitigate the risk of denial-of-service attacks.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>denial-of-service</category><category>vulnerability</category><category>go-lang</category></item></channel></rss>