Java
CVE-2026-35515
MEDIUM
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Input neutralization, injection prevention
|
| Impact | The real-world risk is moderate to high depending on application design. Attack vector is network-based and requires low complexity; however, the attack precondition is strict: the developer must explicitly map user-influenced data (from request parameters, database fields, or other upstream sources) to the type or id fields of SSE messages. Direct HTTP request input does not automatically reach these fields without a developer-introduced data flow. CVSS vector is not provided, but the vulnerability is classified as CWE-74 improper output neutralization. EPSS score and KEV (CISA Known Exploited Vulnerabilities) status are not available in the provided data, suggesting this is a newly disclosed vulnerability without confirmed active exploitation. A public patch exists and is available (v11.1.18), lowering urgency. The impact surfaces as protocol-level injection rather than code execution, constraining the damage model to event spoofing, XSS if client-side rendering is unsafe, and session state corruption. Organizations using NestJS SSE endpoints should prioritize patching based on whether their applications map external data to SSE message type/id fields. |
| Exploit ScenarioDerived | An attacker identifies a NestJS application that streams server-sent events to clients, where the SSE message type or id is derived from a database field or query parameter controlled by user input. The attacker supplies a malicious value such as 'user-event\n\ndata: {"malicious": true}\n\n' in a field that the application maps to message.type. When the server constructs the SSE stream, the injected newline breaks the protocol structure, causing the client's EventSource to parse additional spurious events or corrupt its internal state. If the client renders SSE data as HTML (e.g., updating a DOM element with message content), the injected data could trigger XSS. No public exploit code is referenced in the provided data, and no CISA KEV listing or active exploitation confirmation is available at time of analysis. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Apr 06, 2026
NestJS Core's Server-Sent Events (SSE) stream handler fails to sanitize newline characters in message type and ID fields, allowing remote attackers to inject arbitrary SSE events, spoof event types, and corrupt client reconnection state. Affected versions prior to @nestjs/core@11.1.18 are vulnerable when developers map user-controlled data to SSE message type or id fields. This mirrors a vulnerability patched in Spring Framework and can lead to event spoofing, data injection with XSS potential, and reconnection state corruption if client applications render SSE data without additional sanitization.
RemediationAI
Upgrade @nestjs/core to version 11.1.18 or later. This patched version sanitizes newline characters in message.type and message.id fields before interpolating them into SSE output. Users should update their package.json dependency and run npm install (or equivalent for yarn/pnpm). The patch is available via npm and GitHub release v11.1.18 at https://github.com/nestjs/nest/releases/tag/v11.1.18. The upstream fix is detailed in pull request https://github.com/nestjs/nest/pull/16686 and commit 83558ae774a990a7916141d3abe0b6548ff3a8b2. As a temporary mitigation for applications that cannot update immediately, developers should implement custom validation to reject or escape newline characters in any user-supplied data before assigning it to SSE message type or id fields.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
NestJS Core's SseStream._transform() method directly interpolates the message.type and message.id fields into Server-Sent Events text protocol output. The SSE protocol (RFC 9110 compatible) uses carriage returns (\r) and newlines (\n) as field delimiters and double newlines (\n\n) as event boundaries. When message.type or message.id contain newline characters, they break out of their intended field and create new fields or events in the protocol stream. The CWE-74 (Improper Neutralization of Special Elements in Output) classification reflects the lack of output encoding for protocol-specific delimiters. The npm package @nestjs/core provides the affected SseStream router component. This is functionally identical to the vulnerability patched in Spring Framework via commit 6e97587, which validates id and event fields to prevent protocol injection.
Know when Java gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
Primary rating from Vendor (https://github.com/nestjs/nest).
CVSS VectorVendor: https://github.com/nestjs/nest
Lifecycle Timeline
2DescriptionCVE.org
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
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
Affected Products (CPE)CVE.org
Oracle Java SE 7 Update 6 and earlier contains multiple sandbox bypass vulnerabilities via the ClassFinder and forName m
Remote code execution in IBM Sterling B2B Integrator, Sterling Integrator, and Tivoli Common Reporting allows unauthenti
Java Runtime Environment sandbox bypass via incorrect image channel verification in 2D component allows remote unauthent
Oracle Java SE JDK/JRE 7 and 6 Update 27 and earlier allows remote code execution with complete system compromise throug
JBoss Seam 2 in Red Hat JBoss EAP 4.3.0 fails to sanitize JBoss Expression Language inputs, allowing remote attackers to
Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 update 4 and earlier, 6 up
Multiple vulnerabilities in Oracle Java 7 before Update 11 allow remote attackers to execute arbitrary code by (1) using
Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 2 and earlier, 6 Up
The WLS Security component in Oracle WebLogic Server 10.3.6.0, 12.1.2.0, 12.1.3.0, and 12.2.1.0 allows remote attackers
Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 7 and earlier allow
Remote unauthenticated attackers can execute arbitrary code on Adobe ColdFusion servers through Java deserialization fla
The ExceptionDelegator component in Apache Struts before 2.2.3.1 interprets parameter values as OGNL expressions during
GHSA-36xv-jgw5-4q75
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB