{"id":"CVE-2026-21870","published":"2026-02-13T17:58:37Z","modified":"2026-02-13T18:19:36Z","title":"The BACnet Protocol Stack library has an Off-by-one Stack-based Buffer Overflow in tokenizer_string","vendor":"bacnet-stack","product":"bacnet-stack","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.5,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00247,"percentile":0.09633,"provenance":"source"},"cwes":[{"id":"CWE-193","name":"Off-by-one Error"}],"references":[{"url":"https://github.com/bacnet-stack/bacnet-stack/security/advisories/GHSA-pc83-wp6w-93mx","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/bacnet-stack/bacnet-stack/pull/1196","tags":["x_refsource_MISC"]},{"url":"https://github.com/bacnet-stack/bacnet-stack/commit/4e1176394a5ae50d2fd0b5790d9bff806dc08465","tags":["x_refsource_MISC"]}],"priority":{"score":5.8,"factors":[{"name":"EPSS percentile","points":1.93},{"name":"CVSS severity","points":3.85}]},"vendorSlug":"bacnet-stack","affectedVersions":[{"vendor":"bacnet-stack","product":"bacnet-stack","versions":["<= 1.4.2",">= 1.5.0.rc1, <= 1.5.0.rc2"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-02-13T18:19:25.750164Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2026-5920","exploited":false,"provenance":"source"}}