CVE-2026-42804
massStack Buffer Overflow in Bosch Sensortec BHI360 SensorAPI Debug Parser
A stack-based buffer overflow (CWE-121) exists in the FIFO parsing and debug logging code of the Bosch Sensortec BHI360 SensorAPI C library: bhi360_parse_debug_message() in bhi360_parse.c trusts the first payload byte of a debug frame as a length and copies that many bytes into a fixed 17-byte stack buffer without bounds checking. An attacker who is locally or physically positioned - via a malicious or counterfeit sensor module or a man-in-the-middle on the communication bus - can inject a crafted debug frame with a length byte greater than 16 to trigger the overflow. The overflow corrupts adjacent stack data including the saved return address, and because the buffer is subsequently passed to a printf-style logging sink, injected format specifiers (e.g., %n) can yield arbitrary code execution on the host microcontroller/SoC or a reliable crash (denial of service). Any host firmware that embeds the affected SensorAPI code (up to and including commit d6b200416a) to parse BHI360 FIFO data is exposed; the physical attack vector limits practical risk to devices where an attacker can tamper with the sensor or its bus. No public proof-of-concept, in-the-wild exploitation, or KEV listing is known as of now.
What to do: Rebuild host firmware with a SensorAPI revision newer than commit d6b200416a as soon as Bosch Sensortec publishes a patched commit, and monitor the Bosch Sensortec GitHub repository and the BOSCH PSIRT advisory for the fix. As interim mitigations, add bounds checking on the debug frame length byte (cap it at 16 bytes) before the memcpy into debug_msg, or disable/skip debug-frame parsing in production builds. Check whether your firmware includes bhi360_parse_debug_message() from bhi360_parse.c and whether the sensor bus is physically accessible to tamper or counterfeit hardware.
| Bosch Sensortec BHI360 SensorAPI (C-Library) | all versions up to and including commit d6b200416a |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
A stack-based buffer overflow vulnerability exists in the Bosch Sensortec BHI360 SensorAPI(C-Library) in versions up to and including commit d6b200416a. The vulnerability is located within the FIFO parsing and debug logging subsystem inside the function bhi360_parse_debug_message() in bhi360_parse.c (lines 1852-1875). The parser trusts the first payload byte of a debug frame as the message length (msg_length) and copies that many bytes into a fixed-size 17-byte stack buffer (debug_msg) via memcpy without performing any bounds checking. A locally or physically positioned attacker (e.g., via a malicious sensor, counterfeit hardware module, or a Man-in-the-Middle on the communication bus) can exploit this vulnerability by injecting a crafted debug frame with a length byte exceeding 16. This corrupts adjacent stack data, including the saved return address. Furthermore, because the overflowed buffer is subsequently passed to a printf-style logging sink, the attacker can supply format string specifiers (e.g., %n) to execute arbitrary code on the host microcontroller/SoC or cause a reliable system crash (Denial of Service).
- Weakness
- CWE-121
- Vector
- CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
In the news0 stories
No ingested article mentions this CVE yet.