CVE-2026-42805: Buffer Overflow
A stack-based buffer overflow vulnerability exists in the Bosch Sensortec BHI385 SensorAPI (C library) within the debug message parser function bhi385parsedebugmessage (located in bhi385parse.c). The function parses FIFO events and extracts an 8-bit message length directly from the attacker-controlled event payload (callbackinfo->dataptr[0]) without enforcing bounds checks or clamping the value. When copying the payload into a fixed-size stack buffer of 17 bytes (uint8t debugmsg[17]) via memcpy, providing a length byte greater than 16 causes the function to write past the allocated stack boundary. This memory corruption can be triggered by a malicious or compromised sensor or bus participant, leading to a firmware crash, Denial of Service (DoS), or potentially the execution of arbitrary code via adjacent stack data corruption.
Affected Software
Event History
Frequently Asked Questions
Who is exposed to this issue?
Systems that use the Bosch Sensortec BHI385 SensorAPI and process FIFO events through the debug-message parser are exposed if a malicious or compromised sensor or bus participant can supply event payloads.
What does an attacker need to trigger the overflow?
The attacker needs control of a FIFO event payload reaching bhi385_parse_debug_message. A length byte greater than 16 in the payload causes copying beyond the 17-byte stack buffer.
How can I determine whether my code contains the vulnerable path?
Review SensorAPI source or built artifacts for bhi385_parse_debug_message in bhi385_parse.c. The affected pattern reads callback_info->data_ptr[0] as the message length and uses it in a memcpy into uint8_t debug_msg[17] without validating or clamping the length.