{"id":"CVE-2026-35515","aliases":["CVE-2026-35515","GHSA-36xv-jgw5-4q75"],"related":[],"kind":"vulnerability","state":"published","title":"@nestjs/core Improperly Neutralizes Special Elements in Output Used by a Downstream Component ('Injection')","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Impact\n_What kind of vulnerability is it? Who is impacted?_\n\n[`SseStream._transform()`](https://github.com/nestjs/nest/blob/dea5279ef8fcb568de158003e4281759a2cd7675/packages/core/router/sse-stream.ts) 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](https://github.com/spring-projects/spring-framework/commit/6e9758700a4946be1dca85ca937ef2603e291301)) validates these same fields (`id`, `event`) for the same reason.\n\nActual impact:\n\n- **Event spoofing**: Attacker forges SSE events with arbitrary `event:` types, causing client-side `EventSource.addEventListener()` callbacks to fire for wrong event types.\n- **Data injection**: Attacker injects arbitrary `data:` payloads, potentially triggering XSS if the client renders SSE data as HTML without sanitization.\n- **Reconnection corruption**: Attacker injects `id:` fields, corrupting the `Last-Event-ID` header on reconnection, causing the client to miss or replay events.\n- **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.\n-\n### Patches\n_Has the problem been patched? What versions should users upgrade to?_\n\nPatched in `@nestjs/core@11.1.18`","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-04-06T17:59:51.000Z","modified":"2026-10-26T21:10:00.170Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:L/SA:N","score":6.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:L/SA:N","score":6.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:L","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:L/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:L","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-74"],"affected":[{"ranges":[{"version":"< 11.1.18","status":"affected"}],"vendor":"nestjs","product":"nest","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"11.1.18"}],"ecosystem":"npm","package":"@nestjs/core","purl":"pkg:npm/%40nestjs/core","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"11.1.18"}],"vendor":"nestjs","product":"nest","cpe":"cpe:2.3:a:nestjs:nest:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/nestjs/nest/security/advisories/GHSA-36xv-jgw5-4q75","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-35515","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/nestjs/nest/pull/16686","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nestjs/nest/commit/83558ae774a990a7916141d3abe0b6548ff3a8b2","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nestjs/nest","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/nestjs/nest/releases/tag/v11.1.18","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-04-07T15:48:56.879Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-35515","url":"https://www.cve.org/CVERecord?id=CVE-2026-35515","licence":"CVE Terms of Use","modified":"2026-04-07T15:58:37.067Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-36xv-jgw5-4q75","url":"https://github.com/advisories/GHSA-36xv-jgw5-4q75","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:42.305Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-35515","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-35515","licence":"Public domain","modified":"2026-10-26T21:10:00.170Z"}],"updatedAt":"2026-11-25T22:59:18.121Z","epss":{"score":0.00259,"percentile":0.18778,"date":"2026-12-01T12:00:22.000Z"}}