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-40879

CVE-2026-40879: Nest.js Buffer Overflow Vulnerability

CVE-2026-40879 is a buffer overflow flaw in Nest.js that allows attackers to trigger call stack overflow via small JSON messages. This article covers technical details, affected versions, impact, and mitigation.

Published: April 23, 2026

CVE-2026-40879 Overview

CVE-2026-40879 is a Denial of Service vulnerability affecting NestJS, a popular framework for building scalable Node.js server-side applications. Prior to version 11.1.19, when an attacker sends many small, valid JSON messages in a single TCP frame, the handleData() function recurses once per message while the buffer shrinks with each call. Because maxBufferSize is never reached, the call stack overflows instead. A payload of approximately 47 KB is sufficient to trigger a RangeError, crashing the application.

Critical Impact

Remote attackers can crash NestJS applications with a single malicious TCP payload of ~47 KB, causing complete service disruption without authentication.

Affected Products

  • NestJS versions prior to 11.1.19
  • Node.js server-side applications using vulnerable NestJS framework versions
  • Microservices and APIs built on affected NestJS releases

Discovery Timeline

  • 2026-04-21 - CVE CVE-2026-40879 published to NVD
  • 2026-04-22 - Last updated in NVD database

Technical Details for CVE-2026-40879

Vulnerability Analysis

This vulnerability stems from improper handling of recursion in the handleData() function within NestJS's TCP message processing logic. When processing incoming TCP frames containing multiple small JSON messages, the framework recursively calls handleData() for each message in the buffer. The recursion depth is determined by the number of messages, not the total buffer size.

The core issue is that the maxBufferSize safety check, designed to prevent memory exhaustion, does not protect against call stack exhaustion. Since each recursive call consumes stack space, an attacker can craft a TCP frame with numerous small valid JSON objects that triggers enough recursive calls to overflow the call stack. This results in a RangeError: Maximum call stack size exceeded exception that terminates the Node.js process.

Root Cause

The root cause is classified as CWE-674 (Uncontrolled Recursion). The handleData() function processes JSON messages from the TCP buffer using recursion without limiting the recursion depth. The existing maxBufferSize check only validates the total data size but fails to account for scenarios where many small messages can trigger deep recursion before the buffer size limit is reached.

Attack Vector

The attack can be executed remotely over the network without authentication. An attacker needs to establish a TCP connection to a NestJS microservice and send a single frame containing approximately 47 KB of small, valid JSON messages. Each JSON object triggers one recursive call to handleData(), and the cumulative stack usage from thousands of small messages causes the Node.js runtime to throw a RangeError, crashing the application.

The vulnerability is particularly dangerous because it requires minimal payload size (~47 KB) to achieve denial of service, the attack requires no authentication or special privileges, a single malicious TCP frame can crash the entire application, and the attack is simple to execute with basic networking tools.

Detection Methods for CVE-2026-40879

Indicators of Compromise

  • Unexpected application crashes with RangeError: Maximum call stack size exceeded error messages
  • Node.js process terminations in microservice environments without clear cause
  • Unusually high TCP connection rates to NestJS-based services from single sources
  • Log entries indicating stack overflow conditions in handleData() or related functions

Detection Strategies

  • Monitor application logs for RangeError exceptions, particularly those referencing maximum call stack size
  • Implement network traffic analysis to identify TCP frames with abnormally high numbers of small JSON objects
  • Deploy application performance monitoring (APM) to detect sudden process restarts or crashes
  • Configure alerting for Node.js process terminations across NestJS-based services

Monitoring Recommendations

  • Enable detailed error logging in NestJS applications to capture stack overflow conditions
  • Monitor TCP connection patterns for suspicious traffic targeting microservice ports
  • Implement process health checks with automatic restart and alerting capabilities
  • Track Node.js heap and stack metrics to identify anomalous resource consumption patterns

How to Mitigate CVE-2026-40879

Immediate Actions Required

  • Upgrade NestJS to version 11.1.19 or later immediately
  • Audit all applications using NestJS TCP transport for vulnerable versions
  • Implement rate limiting on TCP connections to NestJS microservices
  • Deploy network-level protections to filter abnormal TCP traffic patterns
  • Configure process managers to restart crashed services while alerting operations teams

Patch Information

The vulnerability has been fixed in NestJS version 11.1.19. Organizations should update their package.json dependencies and redeploy affected applications. For detailed information about the security fix, refer to the GitHub Security Advisory.

Workarounds

  • Implement a reverse proxy or API gateway with request size and rate limiting in front of NestJS services
  • Deploy network firewalls to restrict access to microservice TCP ports to trusted sources only
  • Configure TCP connection limits at the operating system level to reduce attack surface
  • Monitor and alert on process crashes to enable rapid incident response while awaiting patching
bash
# Upgrade NestJS to patched version
npm update @nestjs/core @nestjs/microservices

# Verify installed version
npm list @nestjs/core

# Alternatively, update package.json to require minimum safe version
# "@nestjs/core": "^11.1.19"
# "@nestjs/microservices": "^11.1.19"

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

  • Vulnerability Details
  • TypeBuffer Overflow

  • Vendor/TechNest

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.04%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-674
  • Technical References
  • GitHub Security Advisory
  • Related CVEs
  • CVE-2026-35515: Nest.js Framework XSS 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