CVE-2026-35515
JSON

6.3medium

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

Severity
6.3medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.26% (higher than 18% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-36xv-jgw5-4q75

Description

Nest is a framework for building scalable Node.js server-side applications. Prior to 11.1.18, 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. This vulnerability is fixed in 11.1.18.

Affected

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

All scores

GitHub_M6.3medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:L/SA:N
GitHub6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:L
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:L/SA:N
NVD6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:L

Classification

CWE-74

SSVC (CISA-ADP): exploitation none, automatable no, 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.18, 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. This vulnerability is fixed in 11.1.18.

GitHub Advisory Database
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

NVD (es)

Nest es un framework para construir aplicaciones escalables de Node.js del lado del servidor. Antes de la versión 11.1.18, SseStream._transform() interpola message.type y message.id directamente en la salida del protocolo de texto de Server-Sent Events sin sanear los caracteres de nueva línea (\r, \n). Dado que el protocolo SSE trata tanto \r como \n como delimitadores de campo y \n\n como límites de evento, un atacante que pueda influir en estos campos a través de fuentes de datos ascendentes puede inyectar eventos SSE arbitrarios, suplantar tipos de eventos y corromper el estado de reconexión. Esta vulnerabilidad se corrige en la versión 11.1.18.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-35515 changed 2026-04-07CVE Terms of Use
GitHub Advisory DatabaseGHSA-36xv-jgw5-4q75 changed 2026-09-10CC-BY-4.0
NVDCVE-2026-35515 changed 2026-10-26Public domain