5.5medium
The BACnet Protocol Stack library has an Off-by-one Stack-based Buffer Overflow in tokenizer_string
- Severity
- 5.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.27% (higher than 21% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| bacnet-stack bacnet-stack | <= 1.4.2, >= 1.5.0.rc1, <= 1.5.0.rc2 | CVE List |
| bacnetstack bacnet_stack | up to 1.4.2, 1.5.0 | NVD |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
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.
NVD (es)
La librería de la pila de protocolo BACnet proporciona servicios de comunicación de capa de aplicación, capa de red y capa de acceso al medio (MAC) de BACnet. En las versiones 1.4.2, 1.5.0.rc2 y anteriores, un desbordamiento de búfer basado en pila por un byte en el intérprete ubasic provoca un fallo (SIGABRT) al procesar literales de cadena más largos que el límite del búfer. La función tokenizer_string en src/bacnet/basic/program/ubasic/tokenizer.c maneja incorrectamente la terminación nula para cadenas de longitud máxima. Escribe un byte nulo en dest[40] cuando el tamaño del búfer es solo 40 (índices 0-39), desencadenando un desbordamiento de pila.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-21870 changed 2026-02-13 | CVE Terms of Use |
| NVD | CVE-2026-21870 changed 2026-06-17 | Public domain |