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
    • 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-21870

CVE-2026-21870: BACnet Stack Buffer Overflow Vulnerability

CVE-2026-21870 is a buffer overflow vulnerability in BACnet Protocol Stack library that causes crashes when processing oversized string literals. This article covers the technical details, affected versions, and mitigation.

Published: February 20, 2026

CVE-2026-21870 Overview

CVE-2026-21870 is an off-by-one stack-based buffer overflow vulnerability in the BACnet Protocol Stack library, which provides BACnet application layer, network layer, and media access (MAC) layer communications services. The vulnerability exists in the ubasic interpreter and causes a crash (SIGABRT) when processing string literals longer than the buffer limit. This flaw affects industrial control systems and building automation environments that rely on the BACnet Protocol Stack for communication services.

Critical Impact

An attacker who can provide malicious input to the ubasic interpreter can trigger a denial of service condition by causing the application to crash via stack buffer overflow when processing specially crafted string literals.

Affected Products

  • BACnet Stack versions 1.4.2 and earlier
  • BACnet Stack version 1.5.0-rc1
  • BACnet Stack version 1.5.0-rc2

Discovery Timeline

  • 2026-02-13 - CVE CVE-2026-21870 published to NVD
  • 2026-02-18 - Last updated in NVD database

Technical Details for CVE-2026-21870

Vulnerability Analysis

This vulnerability is classified as CWE-193 (Off-by-one Error), a common programming mistake that occurs when boundary conditions are incorrectly calculated. The flaw resides in the tokenizer_string function within src/bacnet/basic/program/ubasic/tokenizer.c, which is responsible for processing string tokens in the ubasic interpreter.

The vulnerability is exploitable through local access and requires user interaction, such as loading a malicious BACnet program file. When successfully triggered, the overflow corrupts the stack, leading to an immediate application crash. While the vulnerability does not allow for code execution or data exfiltration in its current form, the denial of service impact could be significant in industrial control system environments where continuous operation is critical.

Root Cause

The root cause is an incorrect boundary check in the tokenizer_string function. The code fails to properly account for null termination when copying maximum-length strings. When a string literal reaches exactly the buffer limit (40 characters), the function writes a null byte to dest[40] while the buffer only has valid indices from 0 to 39. This one-byte overflow past the allocated buffer boundary corrupts adjacent stack memory, triggering stack protection mechanisms and causing a SIGABRT signal.

Attack Vector

The attack vector requires local access with user interaction. An attacker would need to craft a malicious input file or program containing a string literal of exactly the maximum buffer length. When the ubasic interpreter processes this input, the off-by-one error causes a write operation one byte past the buffer boundary. The exploitation scenario involves:

  1. Crafting a BACnet program with a string literal of maximum length (40 characters)
  2. Having the target system load and process the malicious program
  3. The tokenizer_string function copies the string and attempts to null-terminate it
  4. The null byte is written to an out-of-bounds memory location, corrupting the stack
  5. Stack smashing protection detects the corruption and aborts the program

The following patch addresses the vulnerability by correcting the boundary check:

c
     } while (*(string_end - 1) == '\\');
 
     string_len = string_end - tree->ptr - 1;
-    if (len < string_len) {
-        string_len = len;
+    if (string_len > len - 1) {
+        /* space for null terminator */
+        string_len = len - 1;
     }
     memcpy(dest, tree->ptr + 1, string_len);
     dest[string_len] = 0;

Source: GitHub Commit 4e11763

Detection Methods for CVE-2026-21870

Indicators of Compromise

  • Unexpected SIGABRT signals or application crashes in BACnet stack processes
  • Core dumps indicating stack smashing detected in tokenizer_string or related ubasic functions
  • Log entries showing abnormal termination of BACnet services when processing program files

Detection Strategies

  • Monitor for unexpected crashes or restarts of BACnet-enabled applications and services
  • Implement file integrity monitoring on BACnet program files to detect potentially malicious modifications
  • Use application crash analysis tools to identify stack overflow patterns in ubasic interpreter components
  • Deploy SentinelOne agents to detect and alert on anomalous process terminations in industrial control environments

Monitoring Recommendations

  • Enable stack trace logging for BACnet applications to capture detailed information during crashes
  • Configure alerting for repeated service restarts that may indicate exploitation attempts
  • Monitor system logs for stack buffer overflow detections and SIGABRT signals

How to Mitigate CVE-2026-21870

Immediate Actions Required

  • Identify all systems running affected BACnet Stack versions (1.4.2, 1.5.0-rc1, 1.5.0-rc2, and earlier)
  • Apply the security patch from the official repository as soon as possible
  • Restrict access to BACnet program file loading functionality to trusted administrators only
  • Implement input validation for any user-supplied program files before processing

Patch Information

The vulnerability has been addressed through a patch available in the official BACnet Stack repository. The fix modifies the boundary check in tokenizer_string to properly reserve space for null termination by checking string_len > len - 1 instead of len < string_len. Organizations should update to a patched version by applying commit 4e1176394a5ae50d2fd0b5790d9bff806dc08465 or by pulling the changes from Pull Request #1196. For detailed information, refer to the GitHub Security Advisory GHSA-pc83-wp6w-93mx.

Workarounds

  • Disable or restrict access to the ubasic interpreter functionality if not required for operations
  • Implement network segmentation to isolate BACnet-enabled systems from untrusted sources
  • Validate and sanitize all input files before processing by the BACnet stack
bash
# Configuration example - Compile with stack protection enabled
gcc -fstack-protector-strong -o bacnet_app bacnet_app.c -lbacnet
# Ensure ASLR is enabled on the system
echo 2 > /proc/sys/kernel/randomize_va_space

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

  • Vulnerability Details
  • TypeBuffer Overflow

  • Vendor/TechBacnet Stack

  • SeverityMEDIUM

  • CVSS Score5.5

  • EPSS Probability0.01%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-193
  • Vendor Resources
  • GitHub Commit Update

  • GitHub Pull Request #1196

  • GitHub Security Advisory GHSA-pc83-wp6w-93mx
  • Related CVEs
  • CVE-2026-21878: BACnet Stack Path Traversal Vulnerability

  • CVE-2026-26264: BACnet Stack DoS Vulnerability
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