CVE-2026-21870
Bacnetstack Bacnet Stack ≤ 1.4.2
Raw vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:HSummary
CVE-2026-21870 is a medium-severity Off-by-one Error (CWE-193) vulnerability in Bacnetstack Bacnet Stack. Its CVSS base score is 5.5 (Medium).
Operationally, exploitation aligns with the MITRE ATT&CK technique Exploitation for Privilege Escalation (T1068); ranked at the 15th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog; a public proof-of-concept is referenced.
The strongest mitigations our analysis identified map to SA-11 (Developer Testing and Evaluation) and SA-15 (Development Process, Standards, and Tools) — see the control section below for these in your framework.
EU & UK References
- 🇪🇺 ENISA EUVD: EUVD-2026-5920
Vulnerability Data
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…
more
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.
- CWE(s)
Related Threats
MITRE ATT&CK Enterprise Techniques
CVEs Like This One
Affected Assets
Mitigating Controls
Control response
—
—
—
V6.2.1
Mitigating Controls (NIST 800-53 r5) AI
Developer testing and evaluation can discover off-by-one errors in loops, bounds, and calculations before deployment.
Requiring documented development standards and tools can embed bounds-checking and arithmetic-correctness rules that stop off-by-one mistakes at introduction.
Mitigating Controls (NIST CSF 2.0) AI
Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.
Secure SDLC practices directly prevent off-by-one errors via reviews, static analysis, and testing.
Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI
Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.
Security testing in development and acceptance can detect off-by-one errors before release.
Secure development life cycle includes requirements and reviews that can catch off-by-one errors.
Application security requirements can specify bounds-checking and input validation to prevent off-by-one errors.
Secure system architecture and engineering principles promote defensive coding practices that reduce off-by-one mistakes.
Secure coding directly addresses off-by-one errors through coding standards and peer review.