CVE-2026-21870: The BACnet Protocol Stack library has an Off-by-one Stack-based Buffer Overflow in tokenizer_string
BACnet Protocol Stack library provides a BACnet application layer, network layer and media access (MAC) layer communications services. In 1.4.2, 1.5.0.rc2, and earlier, an off-by-one stack-based buffer overflow in the ubasic interpreter causes a crash (SIGABRT) when processing string literals longer than the buffer limit. The tokenizerstring function in src/bacnet/basic/program/ubasic/tokenizer.c incorrectly handles null termination for maximum-length strings. It writes a null byte to dest[40] when the buffer size is only 40 (indices 0-39), triggering a stack overflow.
Affected Software
Remediation
Patch Available
Event History
Frequently Asked Questions
What is the severity of CVE-2026-21870?
CVE-2026-21870 has been rated as a high severity vulnerability due to its potential for exploitation via an off-by-one stack-based buffer overflow.
How do I fix CVE-2026-21870?
To fix CVE-2026-21870, upgrade the BACnet Protocol Stack to version 1.5.0.rc3 or later where the vulnerability has been addressed.
What is the impact of CVE-2026-21870?
The impact of CVE-2026-21870 includes potential execution of arbitrary code on the affected system due to the buffer overflow.
Which versions of BACnet Protocol Stack are affected by CVE-2026-21870?
Versions 1.4.2 and 1.5.0.rc2 of the BACnet Protocol Stack are affected by CVE-2026-21870.
Is CVE-2026-21870 a remote vulnerability?
CVE-2026-21870 is a local vulnerability that requires access to an affected application to exploit the buffer overflow.