CVE-2026-21870 The BACnet Protocol Stack library has an Off-by-one Stack-based Buffer Overflow in tokenizer_string

Medium 5.5 Published Updated

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.

Sources

Also known as GHSA-pc83-wp6w-93mx.

Is CVE-2026-21870 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free