CVE-2026-21870 The BACnet Protocol Stack library has an Off-by-one Stack-based Buffer Overflow in tokenizer_string
An off-by-one stack buffer overflow in the BACnet library's tokenizer causes a crash when processing long string literals, leading to denial of service.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- None listed
What is CVE-2026-21870?
CVE-2026-21870 is a medium-severity memory corruption vulnerability in bacnet-stack, published on 13 Feb 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official description
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 tokenizer_string 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.
Weakness: CWE-193
Which versions are affected by CVE-2026-21870?
It affects 1 product.
Products include Bacnetstack Bacnet Stack.
How do I fix CVE-2026-21870?
No fix has been published for CVE-2026-21870 yet. Limit exposure of the affected software until one is available.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is CVE-2026-21870 being exploited?
There is no known exploitation of CVE-2026-21870 in the wild and no public exploit code.
Other vulnerabilities in bacnet-stack
- CVE-2023-51773 Memory corruption in n/a
- CVE-2026-41475 BACnet Stack: Out-of-Bounds Read in WritePropertyMultiple Decoder via Deprecated Tag Parser
- CVE-2026-41502 BACnet Stack: Off-by-One Out-of-Bounds Read in ReadPropertyMultiple Object ID Decoder
- CVE-2026-41503 BACnet Stack: Out-of-Bounds Read in ReadPropertyMultiple Property Decoder via Deprecated Tag Parser
- CVE-2026-26264 BACnet Stack WriteProperty decoding length underflow leads to OOB read and crash
Sources
Also known as GHSA-pc83-wp6w-93mx.