Packages / @nestjs/core / Security

ModerateVulnerabilityGHSA-36xv-jgw5-4q75CVE-2026-35515Published 6 Apr 2026

@nestjs/core Improperly Neutralizes Special Elements in Output Used by a Downstream Component ('Injection')

Affected releases · @nestjs/core

  • 11.x11.0.0 – 11.1.17Fixed in 11.1.18
  • 10.x10.0.0 – 10.4.22No fix on this line yet
  • 9.x and older1.0.2 – 9.4.3No fix, no longer updated

On 11.x, the newest line:

npm install @nestjs/core@11.1.18
12.x
  1. Not affected

    12.0.0 – 12.2.0

    10 releases, latest

11.x
  1. Affected

    11.0.0 – 11.1.17

    40 releases

  2. Fixed

    11.1.18 – 11.2.7

    20 releases

10.x
  1. Affected

    10.0.0 – 10.4.22

    55 releases

9.x
  1. Affected

    9.0.0 – 9.4.3

    37 releases

8.x
  1. Affected

    8.0.0 – 8.4.7

    32 releases

7.x
  1. Affected

    7.0.0 – 7.6.18

    51 releases

6.x
  1. Affected

    6.0.0 – 6.11.11

    67 releases

5.x
  1. Affected

    5.0.0 – 5.7.4

    32 releases

4.x
  1. Affected

    4.0.0 – 4.6.6

    50 releases

3.x
  1. Affected

    3.0.0 – 3.1.1

    8 releases

2.x
  1. Affected

    2.0.0 – 2.1.2

    11 releases

1.x
  1. Affected

    1.0.2

    1 release

414 stable releases of @nestjs/core, oldest to newest, one row per major.

Is your project affected?

Paste your package.json, or type the range you declare for @nestjs/core. It is read in your browser and sent nowhere.

What happens

Impact

What kind of vulnerability is it? Who is impacted?

SseStream._transform() interpolates message.type and message.id directly into Server-Sent Events text protocol output without sanitizing newline characters (\r, \n). Since the SSE protocol treats both \r and \n as field delimiters and \n\n as event boundaries, an attacker who can influence these fields through upstream data sources can inject arbitrary SSE events, spoof event types, and corrupt reconnection state. Spring Framework's own security patch (6e97587) validates these same fields (id, event) for the same reason.

Actual impact:

  • Event spoofing: Attacker forges SSE events with arbitrary event: types, causing client-side EventSource.addEventListener() callbacks to fire for wrong event types.

  • Data injection: Attacker injects arbitrary data: payloads, potentially triggering XSS if the client renders SSE data as HTML without sanitization.

  • Reconnection corruption: Attacker injects id: fields, corrupting the Last-Event-ID header on reconnection, causing the client to miss or replay events.

  • Attack precondition: Requires the developer to map user-influenced data to the type or id fields of SSE messages. Direct HTTP request input does not reach these fields without developer code bridging the gap.

Patches

Has the problem been patched? What versions should users upgrade to?

Patched in @nestjs/core@11.1.18