The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-35515

CVE-2026-35515: Nest.js Framework XSS Vulnerability

CVE-2026-35515 is a cross-site scripting flaw in Nest.js framework affecting Server-Sent Events processing. Attackers can inject arbitrary SSE events by exploiting unsanitized newline characters. This article covers technical details, affected versions, impact, and mitigation strategies.

Published: April 10, 2026

CVE-2026-35515 Overview

CVE-2026-35515 is an injection vulnerability in NestJS, a popular framework for building scalable Node.js server-side applications. The vulnerability exists in the SseStream._transform() function, which interpolates message.type and message.id directly into Server-Sent Events (SSE) 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.

Critical Impact

Attackers can inject malicious SSE events into legitimate streams, potentially spoofing event types and corrupting client reconnection state, leading to data manipulation and denial of service scenarios.

Affected Products

  • NestJS versions prior to 11.1.18

Discovery Timeline

  • 2026-04-07 - CVE CVE-2026-35515 published to NVD
  • 2026-04-08 - Last updated in NVD database

Technical Details for CVE-2026-35515

Vulnerability Analysis

This vulnerability is classified as CWE-74 (Improper Neutralization of Special Elements in Output Used by a Downstream Component), commonly referred to as an Injection vulnerability. The flaw resides in the SSE stream transformation logic within NestJS's core framework.

The Server-Sent Events protocol uses a simple text-based format where fields are delimited by newline characters and events are separated by double newlines. When the SseStream._transform() method processes SSE messages, it constructs the output by directly concatenating user-controllable values (message.type and message.id) into the protocol stream without proper sanitization.

An attacker with control over upstream data sources that populate these message fields can embed newline sequences to break out of the intended field context. This enables several attack scenarios including injection of completely fabricated SSE events, modification of the event type that client-side JavaScript handlers respond to, and manipulation of the id field which affects reconnection behavior through the Last-Event-ID header.

Root Cause

The root cause is insufficient input validation in the SseStream._transform() method. The function fails to sanitize or escape newline characters (\r and \n) in the message.type and message.id fields before incorporating them into the SSE output stream. Since these characters have special meaning in the SSE protocol as field and event delimiters, unsanitized user input containing these characters can alter the structure of the SSE output.

Attack Vector

The attack vector is network-based, requiring an attacker to control or influence data that flows into SSE message construction. This could occur through various upstream data sources such as database content, API responses, user input fields, or message queue payloads. When malicious data containing newline sequences reaches the vulnerable SseStream._transform() function, it gets interpolated directly into the SSE stream, allowing the attacker to inject arbitrary protocol content.

For example, if an attacker can inject the string legitimate\n\nevent: malicious\ndata: payload into the message.type field, the resulting SSE output would contain both the original event context and a completely new injected event that client applications would process as authentic.

Technical details and the security advisory are available at the GitHub Security Advisory.

Detection Methods for CVE-2026-35515

Indicators of Compromise

  • Unexpected or malformed SSE events appearing in browser developer tools or client-side logging
  • SSE streams containing multiple event: or id: fields within a single logical event
  • Client applications processing events with unexpected types or corrupted identifiers
  • Anomalous reconnection behavior from SSE clients due to manipulated Last-Event-ID values

Detection Strategies

  • Implement server-side logging of SSE message content to identify payloads containing raw newline characters in type or id fields
  • Monitor for unusual patterns in SSE traffic such as events with unexpected types or rapid reconnection attempts
  • Deploy application-layer firewalls or WAF rules to detect newline injection attempts in SSE-related endpoints
  • Review upstream data sources feeding into SSE streams for potential injection points

Monitoring Recommendations

  • Enable verbose logging on SSE endpoints to capture the full content of messages being streamed
  • Set up alerts for SSE clients experiencing abnormal reconnection patterns that could indicate id field manipulation
  • Monitor application logs for errors related to malformed SSE data or unexpected event processing
  • Implement integrity checks on critical data before it enters SSE message construction pipelines

How to Mitigate CVE-2026-35515

Immediate Actions Required

  • Upgrade NestJS to version 11.1.18 or later immediately
  • Audit applications using NestJS SSE functionality to identify exposure
  • Review upstream data sources that feed into SSE message type and id fields for potential attacker influence
  • Implement input validation on any user-controllable data before it reaches SSE stream processing

Patch Information

The vulnerability is fixed in NestJS version 11.1.18. The patch sanitizes newline characters in the message.type and message.id fields before they are interpolated into the SSE output stream. Upgrade to this version or later to remediate the vulnerability. For complete details, refer to the GitHub Security Advisory.

Workarounds

  • Implement custom middleware to sanitize SSE message fields by stripping or encoding newline characters (\r, \n) before they reach the SSE stream handler
  • Add input validation at the application layer to reject or escape data containing newline sequences destined for SSE fields
  • Consider implementing a wrapper around SSE endpoints that performs explicit sanitization of event types and identifiers
  • Limit SSE message field values to a strict allowlist where possible to prevent injection of arbitrary content
bash
# Update NestJS to the patched version
npm update @nestjs/core@11.1.18
npm update @nestjs/common@11.1.18

# Verify installed version
npm list @nestjs/core

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechNest

  • SeverityMEDIUM

  • CVSS Score6.3

  • EPSS Probability0.01%

  • Known ExploitedNo
  • CVSS 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityLow
  • CWE References
  • CWE-74
  • Technical References
  • GitHub Security Advisory
  • Related CVEs
  • CVE-2026-40879: Nest.js Buffer Overflow Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English