llamaCVEVulnerability Intelligence
/
Advisory · GitHub · npm · @nestjs/microservices

GHSA-96H4-VGXJ-GVM2

Nest: Unbounded memory growth in the NestJS TCP microservice transport

Texto original en inglés · Ver en español

Parche disponible
Descargar PNG JSON
CVSS
—
medium
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche2 versionesPrimer parche a -15 d de la divulgación
Exposición52 dDesde la divulgación, 30 sept 2026, 9:44 a. m.
Detección47 dDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir
Remediar en la ventana regular de mantenimiento
Estimación de Llama con el árbol SSVC de CISA a partir de la severidad declarada por GHSA (media) y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, no automatizable e impacto técnico parcial. Hay versiones corregidas disponibles.
Hoy toca orden, no heroísmo.Calma e higiene de parches: mi fórmula secreta.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada +1
Explotación
Remediación
Parche 11.2.5 +1
Monitoreo
Detectada
15 sept 26
30 sept 26
17 nov 26
21 nov 26
15 sept 26
2 oct 26
19 oct 26
5 nov 26
21 nov 26
FechaFaseEventoDetalle
Remediación Parche 11.2.5 @nestjs/microservices · -15 d desde divulgación
Remediación Parche 12.0.3 @nestjs/microservices · -15 d desde divulgación
Divulgación Publicada GHSA-96H4-VGXJ-GVM2 divulgada
Divulgación Modificada Última actualización del registro
Monitoreo Detectada Ingresó al índice
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

Summary

A peer that can open a TCP connection to a NestJS microservice using the built-in TCP
transport can make the server process allocate memory without limit, on either side of the
connection, until the process is killed by the OS or by its container memory limit. No
authentication, no credentials, and no valid message are required.

Applications are affected only if they start a microservice with `Transport.TCP` and the
transport's port is reachable by an untrusted peer.

Affected versions

| Package | Affected | Patched |
|---|---|---|
| `@nestjs/microservices` | `>= 12.0.0, < 12.0.3` | 12.0.3 |
| `@nestjs/microservices` | `< 11.2.5` | 11.2.5 |

The same code is present in the 10.x line and earlier. Those lines are end-of-life and
will not receive a patch; upgrade to a supported major.

Only `@nestjs/microservices` is affected. No other package needs updating for this issue.

Details

Two independent paths let one peer grow the heap without bound.

Partial packets are buffered with nothing to reap them

The TCP transport frames messages as `<length>#<payload>`. A peer may declare a length,
send part of the payload, and then stop. `JsonSocket` keeps the partial payload buffered
while it waits for the rest, and nothing ever reclaimed it: there was no socket timeout, no
cap on the number of connections, and no tracking of accepted sockets.

`maxBufferSize` did not close this. It caps a single connection, defaulting to 128M
characters, and is enforced per connection, so the effective ceiling was the number of
connections an attacker chose to open.

Ten connections that each send 20MB and then go silent:

| | rss | heapUsed |
|---|---|---|
| baseline | 152.3MB | 28.1MB |
| after 200MB sent, all stalled | 561.2MB | 229.5MB |

The memory was held for as long as the connections stayed open. Closing them released it,
so a peer could hold it indefinitely at negligible cost to itself.

Response backpressure was ignored

`JsonSocket#handleSend` discarded the return value of `socket.write`. A peer that issues
requests and never reads the responses therefore made the process queue every response in
memory, with no ceiling and no signal to stop producing more.

Thirty requests from a client whose stream is paused, against a handler returning an 8MB
payload, grew rss from 152.4MB to 419.1MB. The amplification here is roughly 1:1, because
the response size is set by the application rather than by the attacker; the defect is that
the server buffers all of it rather than applying backpressure or giving up.

Impact

An unauthenticated peer that can reach the transport's port can drive the process to an
out-of-memory kill. Under a container memory limit this is fast and repeatable, and it
restarts the pod rather than merely degrading it.

There is no confidentiality or integrity impact. Nothing is read, written, or executed;
the failure mode is availability only.

Applications are not affected if the TCP transport is not used, or if the transport's port
is reachable only by trusted peers.

Patches

Upgrade `@nestjs/microservices` to 12.0.3 or 11.2.5.

Three changes landed together:

  • A stall timer drops a peer that stops sending mid-packet. It is armed only while a
  • Reading is suspended while a peer's outgoing buffer is backed up and resumes on
  • Responses queued for a peer that reads nothing are capped. Suspending reads is not

Both limits are configurable on the server and on the client, and either can be disabled by
setting it to `0`.

Behaviour change

Both limits are enabled by default, following the precedent set by `maxBufferSize`. A peer
that stops sending mid-packet for 30 seconds, or that lets more than 128MB of responses
queue unread on a single connection, is now disconnected where previously it was not.

The send cap can also drop a peer that is genuinely reading, if responses are produced
faster than the socket drains for long enough. The default is set high for that reason.
Applications that stream very large responses to deliberately slow consumers should raise
`maxSendBufferSize` or set it to `0`.

Workarounds

For anyone who cannot upgrade immediately:

  • Restrict who can reach the port. The TCP transport is designed for trusted
  • Lower `maxBufferSize`. This reduces what a single connection can pin on the receive
  • Supply a custom `socketClass`. An application-provided socket class can implement its

Setting a process memory limit does not mitigate this. It converts the failure from an
out-of-memory kill of the host into an out-of-memory kill of the process.

Credit

Reported by Salman Aljardan, who provided a detailed write-up and self-contained proofs of
concept for each issue, and coordinated disclosure.

Versiones

Rangos afectados

Afectada Corregida Última
@nestjs/microservices< 11.2.5
@nestjs/microservices≥ 12.0.0 < 12.0.3
11.2.5
12.0.0
12.0.3
12.5.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
npm@nestjs/microservices
Corregida 11.2.5, 12.0.3 -15 d · -15 d 12.5.0 no afectada
Versiones corregidas11.2.512.0.3
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Otrahttps://github.com/nestjs/nest/security/advisories/GHSA-96h4-vgxj-gvm2
Otrahttps://github.com/nestjs/nest/pull/17746
Otrahttps://github.com/nestjs/nest/pull/17749
Otrahttps://github.com/nestjs/nest/commit/6ca2dd894a6ff964d318724f363061652e822920
Otrahttps://github.com/nestjs/nest/commit/781843ac98d429fe1d541c52c7126850be5989a7
Otrahttps://github.com/nestjs/nest/commit/dee4ed4dbc2e18e1e722619927647f5441dfe812
Otrahttps://github.com/nestjs/nest
Otrahttps://github.com/nestjs/nest/releases/tag/v11.2.5
Otrahttps://github.com/nestjs/nest/releases/tag/v12.0.3

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.