Reliance on Undefined, Unspecified, or Implementation-Defined Behavior Affecting bacnet package, versions [,1.4.3)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.03% (10th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-UNMANAGED-BACNET-16152886
  • published23 Apr 2026
  • disclosed22 Apr 2026
  • creditJorge Barredo

Introduced: 22 Apr 2026

NewCVE-2026-40279  (opens in a new tab)
CWE-758  (opens in a new tab)

How to fix?

Upgrade bacnet to version 1.4.3 or higher.

Overview

Affected versions of this package are vulnerable to Reliance on Undefined, Unspecified, or Implementation-Defined Behavior via the decode_signed32() function in src/bacnet/bacint.c that reconstructs a 32-bit signed integer from four APDU bytes using signed left shifts. When any of the four bytes has bit 7 set (value ≥ 0x80), the left-shift operation overflows a signed int32_t, which is undefined behavior per the C standard. This is flagged thousands of times per minute by UndefinedBehaviorSanitizer on any BACnet input containing signed-integer property values with high-bit-set bytes.

PoC

/* poc_bacnet001.c */
#include 
#include "bacnet/bacint.h"

int main(void) {
    uint8_t apdu[4] = { 0x91, 0x02, 0x00, 0x00 };   /* 0x91 = 145, bit 7 set */
    int32_t v;
    decode_signed32(apdu, &v);
    return 0;
}

CVSS Base Scores

version 4.0
version 3.1