Moleculer: Unauthenticated Denial of Service via negative length field in the TCP transporter packet parser
Summary
The TCP transporter's packet parser (src/transporters/tcp/parser.js) reads the packet length field with Buffer.prototype.readInt32BE, a signed read. A crafted packet whose length field has the sign bit set yields a negative length. The parser then advances past the parsed message with packet = packet.slice(length), but Buffer.prototype.slice clamps an out-of-range negative start index to 0, so the buffer is returned unchanged. The while (packet.length > 0) loop condition therefore never becomes false, producing an infinite synchronous loop that blocks the Node.js event loop indefinitely.
Impact
Any Moleculer node using the TCP transporter can be rendered completely unresponsive by an unauthenticated remote peer sending a single ~10-byte crafted TCP packet, before any protocol handshake or authentication takes place. TcpReader.onTcpClientConnected pipes each accepted socket's bytes straight into a fresh Parser instance (socket.pipe(parser)) with no handshake, so the code path is reachable by any peer able to reach the transporter's listening port. Because Node.js is single-threaded, the hang blocks the entire event loop of the process, taking down every service hosted in it until it is forcibly restarted. TCP transporter endpoints are frequently auto-discovered via UDP broadcast, so any host on the same network segment can reach the port.
Neither the CRC check nor maxPacketSize mitigate the issue: the CRC bytes are fully attacker-computable, and maxPacketSize bounds the received buffer size, not the value of the length field.
Affected component
Parser._write in src/transporters/tcp/parser.js.
Credit
Reported by xor4xor via the Tidelift security program.
What to do
Upgrade to Moleculer version 0.14.36, 0.15.2, or later. The patch validates that the decoded length is at least the 6-byte header size before processing, rejecting negative and undersized values with an error on the write callback instead of looping.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | moleculer | >= 0.15.0-beta1, < 0.15.2, < 0.14.36 | 0.15.2, 0.14.36 |
References
- https://github.com/moleculerjs/moleculer/security/advisories/GHSA-h89v-g948-47vp
- https://nvd.nist.gov/vuln/detail/CVE-2026-97705
- https://github.com/moleculerjs/moleculer/commit/168ecbdc245c9a9d1dc4ef9b8a81dbae38ee3063
- https://github.com/moleculerjs/moleculer/commit/914074e502ae403a0338ad168b45b16d6bcc3e44
- https://github.com/moleculerjs/moleculer
- https://github.com/moleculerjs/moleculer/releases/tag/v0.14.36
- https://github.com/moleculerjs/moleculer/releases/tag/v0.15.2
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H- Weakness (CWE)
CWE-835- Platform
- npm
- Package
moleculer- Disclosed
- 09.11.2026
- Updated
- 11.11.2026 10:00
Sources and licenses · Edited or translated by DockRay; source rights and applicable licenses are retained.
OSV / GitHub Advisory Database - GHSA-h89v-g948-47vp - CC BY 4.0
Vulnerability history: moleculer
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
This is the only known vulnerability of this package.
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.