CVE-2026-40879

Nest: DoS via Recursive handleData in JsonSocket (TCP Transport)

Published Apr 21, 2026 CVSS 3.1 · 7.5 High EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

A vulnerability in the Nest framework’s JsonSocket TCP transport causes handleData() to recurse once per incoming JSON message. When an attacker sends many small, valid JSON messages in a single TCP frame, the recursion depth grows until a RangeError is thrown, resulting in an application crash. This recursive overflow falls under CWE‑674 and leads to a denial‑of‑service impact.

Affected Systems

All versions of the Nest framework prior to 11.1.19 are affected. Users running any 11.x release before 11.1.19 should consider themselves vulnerable.

Risk and Exploitability

The CVSS score of 7.5 indicates a medium‑to‑high severity. Because no EPSS score is available, the exact likelihood of exploitation is unknown, but the flaw is reachable over an untrusted network via a crafted TCP frame, implying a potential remote DoS. The vulnerability is not listed in CISA’s KEV catalog. Exploitation requires only the ability to send data to the application’s TCP socket, so authentication is not needed and the attack can be performed from the Internet if the listener is exposed.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to NestJS 11.1.19 or later to apply the fixed recursion handling in handleData().
  • Configure the application or network to limit the size and rate of incoming TCP frames, ensuring that large or rapid JSON payloads cannot be processed. This can be achieved by setting a maximum frame size or by implementing rate limiting on JSON message reception.
  • Restrict access to the Nest server through firewall rules or network segmentation so that only trusted sources can reach the vulnerable TCP socket.

Generated by OpenCVE AI on April 22, 2026 at 05:32 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-hpwf-8g29-85qm Nest Affected by DoS via Recursive handleData in JsonSocket (TCP Transport)
History
Type Values Removed Values Added
CPEs cpe:2.3:a:nestjs:nest:*:*:*:*:*:node.js:*:*
Type Values Removed Values Added
First Time appeared Nestjs
Nestjs nest
Vendors & Products Nestjs
Nestjs nest
Type Values Removed Values Added
Description 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.
Title Nest: DoS via Recursive handleData in JsonSocket (TCP Transport)
Weaknesses CWE-674
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}

ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Apr 21, 2026, 7:38 PM
Reserved
Apr 15, 2026, 3:57 PM
Status
Analyzed
Published
Apr 21, 2026, 8:17 PM
Modified
Oct 26, 2026, 9:10 PM