@nestjs/core Improperly Neutralizes Special Elements in Output Used by a Downstream Component ('Injection')
Published 6 Apr 2026 · Updated 10 Sept 2026
Affected package
- Affected
- <11.1.18
- Fixed in
- 11.1.18
npm install @nestjs/core@11.1.18Details
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-sideEventSource.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 theLast-Event-IDheader on reconnection, causing the client to miss or replay events. - Attack precondition: Requires the developer to map user-influenced data to the
typeoridfields 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
Is GHSA-36xv-jgw5-4q75 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected @nestjs/core, and gives you the command that fixes it.
References
- Linkgithub.com/nestjs/nest/security/advisories/GHSA-36xv-jgw5-4q75
- Advisorynvd.nist.gov/vuln/detail/CVE-2026-35515
- Linkgithub.com/nestjs/nest/pull/16686
- Linkgithub.com/nestjs/nest/commit/83558ae774a990a7916141d3abe0b6548ff3a8b2
- Packagegithub.com/nestjs/nest
- Linkgithub.com/nestjs/nest/releases/tag/v11.1.18
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.