CVE-2026-40879
JSON

7.5high

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

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
0.34% (higher than 29% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-hpwf-8g29-85qm

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.

Affected

Product or packageVersionsReported by
nestjs nest< 11.1.19, before 11.1.19CVE List, NVD
@nestjs/microservices (npm)before 11.1.19GitHub Advisory Database

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-674CWE-770

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database
Impact

Attacker sends many small, valid JSON messages in one TCP frame → handleData() recurses once per message; buffer shrinks each call → maxBufferSize is never reached; call stack overflows instead → A ~47 KB payload is sufficient to trigger RangeError

Patches

Fixed in @nestjs/microservices@11.1.19

References

Discovered by https://github.com/hwpark6804-gif

NVD (es)

Nest es un framework para construir aplicaciones escalables de Node.js del lado del servidor. Antes de la versión 11.1.19, cuando un atacante envía muchos mensajes JSON pequeños y válidos en una única trama TCP, handleData() recurre una vez por mensaje; el búfer se reduce en cada llamada. maxBufferSize nunca se alcanza; en su lugar, la pila de llamadas se desborda. Una carga útil de ~47 KB es suficiente para activar un RangeError. Esta vulnerabilidad se corrige en la versión 11.1.19.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-40879 changed 2026-04-21CVE Terms of Use
GitHub Advisory DatabaseGHSA-hpwf-8g29-85qm changed 2026-05-05CC-BY-4.0
NVDCVE-2026-40879 changed 2026-10-26Public domain