nestjs/nest · Security
Nest Affected by DoS via Recursive handleData in JsonSocket (TCP Transport)
- GHSA ID
- GHSA-hpwf-8g29-85qm
- CVE ID
- CVE-2026-40879
- Severity
- high
- Published
- Updated
- CVSS
- 7.5 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- CVSS v3
- 7.5 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Description
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/[email protected]
References
Discovered by https://github.com/hwpark6804-gif
CWEs
- CWE-674 · Uncontrolled Recursion
- CWE-770 · Allocation of Resources Without Limits or Throttling