VYPR
Medium severity6.1NVD Advisory· Published Apr 7, 2026· Updated Apr 17, 2026

CVE-2026-35515

CVE-2026-35515

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 packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
@nestjs/corenpm
< 11.1.1811.1.18

Affected products

1
  • cpe:2.3:a:nestjs:nest:*:*:*:*:*:node.js:*:*
    Range: <11.1.18

Patches

1
83558ae774a9

Merge pull request #16686 from nestjs/fix/sanitize-sse-message

https://github.com/nestjs/nestKamil MysliwiecApr 3, 2026via ghsa
1 file changed · +6 3
  • packages/core/router/sse-stream.ts+6 3 modified
    @@ -97,9 +97,12 @@ export class SseStream extends Transform {
         encoding: string,
         callback: (error?: Error | null, data?: any) => void,
       ) {
    -    let data = message.type ? `event: ${message.type}\n` : '';
    -    data += message.id ? `id: ${message.id}\n` : '';
    -    data += message.retry ? `retry: ${message.retry}\n` : '';
    +    const sanitize = (val: string | number) =>
    +      String(val).replace(/[\r\n]/g, '');
    +
    +    let data = message.type ? `event: ${sanitize(message.type)}\n` : '';
    +    data += message.id ? `id: ${sanitize(message.id)}\n` : '';
    +    data += message.retry ? `retry: ${sanitize(message.retry)}\n` : '';
         data += message.data ? toDataString(message.data) : '';
         data += '\n';
         this.push(data);
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

6

News mentions

0

No linked articles in our index yet.