<?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>Nestjs — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/nestjs/</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, 22 Apr 2026 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/nestjs/feed.xml" rel="self" type="application/rss+xml"/><item><title>NestJS Uncontrolled Recursion Denial-of-Service Vulnerability (CVE-2026-40879)</title><link>https://feed.craftedsignal.io/briefs/2026-04-nest-recursion-dos/</link><pubDate>Wed, 22 Apr 2026 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-04-nest-recursion-dos/</guid><description>NestJS versions before 11.1.19 are susceptible to an uncontrolled recursion vulnerability (CVE-2026-40879) where sending many small JSON messages in a single TCP frame triggers a call stack overflow, resulting in a denial-of-service condition.</description><content:encoded><![CDATA[<p>NestJS, a Node.js framework for server-side applications, is vulnerable to an uncontrolled recursion issue. Prior to version 11.1.19, a malicious actor could exploit CVE-2026-40879 by sending a crafted TCP frame containing numerous small, valid JSON messages to a vulnerable NestJS application. The <code>handleData()</code> function recursively processes each message, causing the buffer to shrink with each call. This bypasses the <code>maxBufferSize</code> limit and leads to a call stack overflow. A payload as small as 47 KB is sufficient to trigger a <code>RangeError</code> and crash the application. This vulnerability allows for a denial-of-service attack. The vulnerability has been patched in NestJS version 11.1.19.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker identifies a NestJS application running a version prior to 11.1.19.</li>
<li>The attacker crafts a TCP packet containing multiple small, valid JSON messages.</li>
<li>The attacker sends the crafted TCP packet to the vulnerable NestJS application.</li>
<li>The NestJS application&rsquo;s <code>handleData()</code> function receives the TCP packet.</li>
<li>The <code>handleData()</code> function recursively processes each JSON message in the packet.</li>
<li>With each recursive call, the buffer shrinks.</li>
<li>The <code>maxBufferSize</code> is never reached because of the stack overflow.</li>
<li>The call stack overflows, leading to a <code>RangeError</code> and application crash, resulting in a denial of service.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of CVE-2026-40879 leads to a denial-of-service condition. A single attacker can potentially bring down a vulnerable NestJS application with a relatively small payload of approximately 47KB. This can impact businesses relying on the affected NestJS application, leading to service disruptions and potential data loss. The vulnerability affects any application using NestJS versions before 11.1.19, making a large number of applications potentially vulnerable.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade all NestJS applications to version 11.1.19 or later to patch CVE-2026-40879.</li>
<li>Deploy the Sigma rule <code>Detect Suspicious NestJS TCP Payload</code> to identify potentially malicious TCP traffic targeting NestJS applications.</li>
<li>Monitor network traffic for large TCP packets containing many small JSON messages, which may indicate an attempted exploit.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>denial-of-service</category><category>nestjs</category><category>recursion</category><category>cve-2026-40879</category><category>linux</category></item><item><title>NestJS Microservices Denial-of-Service via Recursive handleData</title><link>https://feed.craftedsignal.io/briefs/2026-04-nestjs-dos/</link><pubDate>Tue, 14 Apr 2026 00:15:09 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-04-nestjs-dos/</guid><description>A denial-of-service vulnerability exists in NestJS's @nestjs/microservices package, affecting versions 11.1.18 and earlier, where an attacker can send multiple small, valid JSON messages within a single TCP frame, causing a stack overflow.</description><content:encoded><![CDATA[<p>A denial-of-service vulnerability has been identified in the <code>@nestjs/microservices</code> package, specifically impacting versions up to and including 11.1.18. This vulnerability arises from the recursive nature of the <code>handleData()</code> function when processing JSON messages over TCP. An attacker can exploit this by sending a single TCP frame containing numerous small, valid JSON messages. This triggers excessive recursion, rapidly consuming stack space and ultimately leading to a stack overflow. A relatively small payload of approximately 47 KB is sufficient to trigger the <code>RangeError</code> and cause the application to crash, effectively denying service to legitimate users. The vulnerability was discovered by <a href="https://github.com/hwpark6804-gif">https://github.com/hwpark6804-gif</a> and has been addressed in version 11.1.19 of the <code>@nestjs/microservices</code> package.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>The attacker establishes a TCP connection to the NestJS microservice endpoint.</li>
<li>The attacker crafts a TCP frame containing multiple small, valid JSON messages.</li>
<li>The attacker sends the crafted TCP frame to the microservice.</li>
<li>The <code>handleData()</code> function in <code>@nestjs/microservices</code> receives the TCP frame.</li>
<li>For each JSON message in the frame, <code>handleData()</code> recursively calls itself.</li>
<li>With each recursive call, the buffer size shrinks, preventing the <code>maxBufferSize</code> from being reached.</li>
<li>The call stack overflows due to the excessive recursion.</li>
<li>A <code>RangeError</code> is triggered, crashing the NestJS microservice and causing a denial of service.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability results in a denial-of-service condition, rendering the affected NestJS microservice unavailable. This can disrupt critical application functionality that relies on the microservice. While the specific number of victims or sectors targeted is unknown, any application using a vulnerable version of <code>@nestjs/microservices</code> is susceptible. A successful attack leads to application downtime and potential data loss or corruption if the microservice is responsible for data persistence.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade the <code>@nestjs/microservices</code> package to version 11.1.19 or later to remediate the vulnerability (reference: <code>@nestjs/microservices@11.1.19</code>).</li>
<li>Deploy the Sigma rule &ldquo;Detect Excessive TCP Data&rdquo; to identify potential exploitation attempts by monitoring for unusually large TCP packets (reference: rule &ldquo;Detect Excessive TCP Data&rdquo;).</li>
<li>Monitor network traffic for connections sending abnormally large amounts of data to NestJS microservice endpoints.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>nestjs</category><category>denial-of-service</category><category>microservices</category></item></channel></rss>