GitHub Advisoryadvisory · npm
GHSA-36xv-jgw5-4q75 @nestjs/core Improperly Neutralizes Special Elements in Output Used by a Downstream Component ('Injection')
MEDIUM
Official page ↗
- Aliases
- CVE-2026-35515
- Ecosystem
- npm
- Packages
- @nestjs/core
- Severity
- Moderate
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:L
- Weaknesses
- CWE-74
- Reviewed
- 2026-04-06
Affected packages
• npm @nestjs/core: < 11.1.18 → fixed in 11.1.18
Description
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/[email protected]`
Related
Alias · CVE (1)
- CVE-2026-35515 Nest is a framework for building scalable Node.js server-side applications. vulnerability
Weakness · CWE (1)
- CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component weakness
References
- https://github.com/nestjs/nest/security/advisories/GHSA-36xv-jgw5-4q75 web
- https://nvd.nist.gov/vuln/detail/CVE-2026-35515 advisory
- https://github.com/nestjs/nest/pull/16686 web
- https://github.com/nestjs/nest/commit/83558ae774a990a7916141d3abe0b6548ff3a8b2 web
- https://github.com/nestjs/nest package
- https://github.com/nestjs/nest/releases/tag/v11.1.18 web