Nest.js CVE-2026-40879
HIGHAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessEstablish TCP connection to Nest.js endpoint
-
DeliverySend 47 KB frame with 100+ small JSON messages
-
ExploitTrigger recursive handleData() processing
-
ExecutionExhaust call stack
-
ImpactRangeError crash terminates Node.js process
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Recursion depth limits
|
| Exploitation Conditions | Requires target application to use Nest.js versions prior to 11.1.19 with TCP-based message handling enabled for JSON payloads. Vulnerability triggers specifically when processing concatenated small JSON messages within a single TCP frame rather than traditional large-buffer attacks. Applications using HTTP-only request/response patterns without persistent TCP connections (pure RESTful JSON over standard HTTP libraries) may have reduced attack surface, though microservices using @nestjs/microservices with TCP transport are primary targets. No special network positioning required-any network path allowing TCP connection establishment to vulnerable endpoints enables exploitation (AV:N). No authentication, user interaction, or non-default configuration needed (PR:N/UI:N); default Nest.js installations processing JSON over TCP are exploitable. |
| Impact | Real-world risk is MODERATE despite 7.5 CVSS score. Attack vector is network-accessible with low complexity and no authentication (AV:N/AC:L/PR:N/UI:N), making exploitation trivial for remote attackers. However, impact is purely availability (C:N/I:N/A:H)-no data exfiltration or code execution. The 47 KB payload threshold is extremely low, enabling resource-efficient attacks against internet-facing Nest.js APIs. No public exploit code confirmed at time of analysis, and absence from CISA KEV suggests no widespread exploitation observed. SSVC assessment: exploitation status unknown, likely automatable given simplicity, technical impact limited to service crash. Priority depends on application criticality: HIGH for customer-facing production APIs where availability is business-critical, MEDIUM for internal services with redundancy. The ease of exploitation (single malformed TCP packet) and prevalence of Nest.js in modern microservices architectures elevate practical risk beyond a simple DoS. |
| Exploit ScenarioDerived | An attacker identifies a publicly accessible Nest.js API endpoint (e.g., REST or GraphQL service) and crafts a TCP packet containing approximately 100 small valid JSON objects (total ~47 KB) concatenated without separators. When this single frame arrives at the handleData() function, recursive parsing begins-each message triggers a new stack frame until the call stack overflows around message 95-100, throwing RangeError and crashing the Node.js worker process. The attacker repeats this low-bandwidth attack (under 50 KB per request) against all worker instances, achieving sustained denial of service with minimal resources. Public exploit code not identified at time of analysis, but attack implementation is straightforward given detailed vulnerability description. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Apr 21, 2026
Remote attackers can crash Nest.js applications (versions prior to 11.1.19) by sending approximately 47 KB of fragmented JSON messages within a single TCP frame, triggering a call stack overflow. The handleData() function's recursive processing of small valid JSON messages causes stack exhaustion before maxBufferSize limits are enforced, resulting in RangeError and denial of service. No authentication required (CVSS AV:N/PR:N). Vendor patch released in version 11.1.19. EPSS data not available; no confirmed active exploitation (not in CISA KEV).
RemediationAI
Upgrade Nest.js to version 11.1.19 or later, which implements iterative message processing to prevent call stack overflow. Update package.json dependency to "@nestjs/core": "^11.1.19" and run npm install or yarn install, followed by application restart. Review the GitHub security advisory at https://github.com/nestjs/nest/security/advisories/GHSA-hpwf-8g29-85qm for complete upgrade instructions. If immediate patching is not feasible, implement compensating controls: (1) Deploy application-layer rate limiting to restrict TCP connections per source IP (limit 10 connections/minute), which reduces attack surface but may impact legitimate high-volume clients; (2) Configure upstream reverse proxy (nginx/HAProxy) with client_body_buffer_size limits and connection timeouts to reject oversized or slow requests-note this may false-positive on mobile clients with variable connectivity; (3) Enable process monitoring with automatic restart policies (PM2, Kubernetes liveness probes) to recover from crashes within seconds, though this only mitigates availability impact without preventing exploitation.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Nest.js is a progressive Node.js framework for building server-side applications, using TypeScript and following Angular-like architectural patterns. This vulnerability (CWE-674: Uncontrolled Recursion) resides in the TCP message parsing layer where handleData() processes incoming data streams. When multiple small, well-formed JSON messages arrive concatenated in a single TCP frame, the parser enters recursive processing-shrinking the buffer incrementally with each parsed message rather than iterating. The recursion depth correlates with message count, not total payload size, allowing attackers to bypass the maxBufferSize protection mechanism entirely. The call stack exhausts before buffer size limits trigger, causing JavaScript runtime RangeError exceptions that crash the Node.js process.
Know when Nest gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Primary rating from Vendor (GitHub_M) · only source for this CVE.
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
Nest is a framework for building scalable Node.js server-side applications. Prior to 11.1.19, when an attacker sends many small, valid JSON messages in one TCP frame, handleData() recurses once per message; the buffer shrinks each call. maxBufferSize is never reached; call stack overflows instead. A ~47 KB payload is sufficient to trigger RangeError. This vulnerability is fixed in 11.1.19.
Blast Radius
ecosystem impact- 2 npm packages depend on @nestjs/microservices (2 direct, 0 indirect)
Ecosystem-wide dependent count for version 11.1.19.
Executive ViewAI
Nest.js applications running versions before 11.1.19 are vulnerable to unauthenticated remote denial-of-service attacks where attackers can crash services by sending specially crafted fragmented JSON payloads. This vulnerability affects any internet-facing Nest.js application and could disrupt business operations by making services unavailable to legitimate users.
Pending vendor patch deployment: implement network-level rate limiting on JSON message ingestion, configure reverse proxy buffer size limits below 47 KB per connection, and establish connection timeout policies to interrupt sustained fragmented message attacks. Monitor application logs for RangeError stack overflow events. Apply vendor patch as primary remediation once version 11.1.19 is available and tested.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
Affected Products (CPE)CVE.org
A remote, unauthenticated denial-of-service condition in the NestJS (Nest) microservices framework lets an attacker cras
Authentication and authorization bypass in NestJS affects only applications served through the Fastify adapter: @nestjs/
Denial of service in OpenThread, the open-source Thread networking stack embedded in Google Nest devices (identified as
File Upload vulnerability in nestjs nest v.10.3.2 allows a remote attacker to execute arbitrary code via the Content-Typ
Versions of the package @nestjs/core before 9.0.5 are vulnerable to Information Exposure via the StreamableFile pipe. Ra
A NestJS application using @nestjs/platform-fastify can allow bypass of authentication/authorization middleware when Fas
GHSA-hpwf-8g29-85qm
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB