Nest.js CVE-2026-40879
HIGHSeverity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Primary rating from GitHub Advisory · only source for this CVE.
CVSS VectorGitHub Advisory
Lifecycle Timeline
5Blast Radius
ecosystem impact- 2 npm packages depend on @nestjs/microservices (2 direct, 0 indirect)
Ecosystem-wide dependent count for version 11.1.19.
DescriptionGitHub Advisory
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.
AnalysisAI
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).
Technical ContextAI
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.
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.
A vulnerability in the NuPoint Unified Messaging (NPM) component of Mitel MiCollab through 9.8 SP1 FP2 (9.8.1.201) could
FortiOS and FortiProxy contain an authentication bypass via the Node.js websocket module allowing unauthenticated remote
Denial of service against HTTP/2 server implementations allows remote unauthenticated attackers to exhaust server resour
Eval injection vulnerability in the internals.batch function in lib/batch.js in the bassmaster plugin before 1.5.2 for t
Flowise version 3.0.5 contains a remote code execution vulnerability in the CustomMCP node. The mcpServerConfig paramete
Node.js 8.5.0 before 8.6.0 allows remote attackers to access unintended files, because a change to ".." handling was inc
An issue was discovered in the node-serialize package 0.0.4 for Node.js. Rated critical severity (CVSS 9.8), this vulner
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
Directory traversal vulnerability in the st module before 0.2.5 for Node.js allows remote attackers to read arbitrary fi
Multiple SQL injection vulnerabilities in the Manage Accounts page in the AccountManagement.asmx service in the Solarwin
The JS-YAML module before 2.0.5 for Node.js parses input without properly considering the unsafe !!js/function tag, whic
The AES-NI implementation in OpenSSL before 1.0.1t and 1.0.2 before 1.0.2h does not consider memory allocation during a
Same weakness CWE-674 – Uncontrolled Recursion
View allSame technique Buffer Overflow
View allShare
External POC / Exploit Code
Leaving vuln.today
GHSA-hpwf-8g29-85qm