CVE-2026-21870

5.5 MEDIUM

📋 TL;DR

This CVE describes an off-by-one stack-based buffer overflow in the BACnet Protocol Stack library's ubasic interpreter. When processing string literals longer than the 40-byte buffer limit, the tokenizer_string function incorrectly writes a null byte beyond the buffer boundary, causing a crash (SIGABRT). This affects systems using BACnet for building automation and control communications.

💻 Affected Systems

Products:
  • BACnet Protocol Stack library
Versions: 1.4.2, 1.5.0.rc2, and earlier versions
Operating Systems: All platforms running the BACnet stack
Default Config Vulnerable: ⚠️ Yes
Notes: Any system using the ubasic interpreter functionality in the BACnet stack is vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise if an attacker can control the overflow to execute arbitrary code.

🟠

Likely Case

Denial of service through application crash (SIGABRT) when processing maliciously crafted BACnet packets.

🟢

If Mitigated

Application crash with limited impact if stack protections (ASLR, stack canaries) are enabled.

🌐 Internet-Facing: MEDIUM - BACnet devices are often on isolated networks but some may be internet-accessible.
🏢 Internal Only: MEDIUM - BACnet networks are typically internal but widespread in building automation systems.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploitation requires sending specially crafted BACnet packets to vulnerable systems.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Fixed in commit 4e1176394a5ae50d2fd0b5790d9bff806dc08465

Vendor Advisory: https://github.com/bacnet-stack/bacnet-stack/security/advisories/GHSA-pc83-wp6w-93mx

Restart Required: Yes

Instructions:

1. Update to the latest BACnet Protocol Stack version. 2. Rebuild and redeploy applications using the library. 3. Restart affected BACnet services.

🔧 Temporary Workarounds

Disable ubasic interpreter

all

If ubasic functionality is not required, disable it in the BACnet stack configuration.

Configure BACnet stack to disable ubasic interpreter support

Network segmentation

linux

Isolate BACnet networks from untrusted networks using firewalls.

iptables -A INPUT -p udp --dport 47808 -j DROP # Block BACnet port

🧯 If You Can't Patch

  • Implement strict network access controls to limit BACnet traffic to trusted sources only.
  • Deploy intrusion detection systems to monitor for anomalous BACnet packet patterns.

🔍 How to Verify

Check if Vulnerable:

Check if BACnet stack version is 1.4.2, 1.5.0.rc2, or earlier. Review application dependencies for vulnerable library versions.

Check Version:

Check build configuration or source code for BACNET_STACK_VERSION define

Verify Fix Applied:

Verify the BACnet stack includes commit 4e1176394a5ae50d2fd0b5790d9bff806dc08465 or later.

📡 Detection & Monitoring

Log Indicators:

  • SIGABRT crashes in BACnet-related processes
  • Stack trace references tokenizer_string function

Network Indicators:

  • Unusual BACnet packet patterns with long string literals
  • Traffic to UDP port 47808 (BACnet standard port)

SIEM Query:

process:name="bacnet*" AND signal:SIGABRT

🔗 References

📤 Share & Export