Skip to main content
Vulnerability Database/CVE-2026-42805

CVE-2026-42805: Bosch BHI385 SensorAPI Buffer Overflow

CVE-2026-42805 is a stack-based buffer overflow in Bosch Sensortec BHI385 SensorAPI that occurs when parsing debug messages with unchecked length values, allowing memory corruption. This article covers technical details, impact analysis, and mitigation strategies.

Published:

CVE-2026-42805 Overview

CVE-2026-42805 is a stack-based buffer overflow [CWE-121] in the Bosch Sensortec BHI385 SensorAPI C library. The flaw resides in the bhi385_parse_debug_message function inside bhi385_parse.c. The function reads an 8-bit length value from an attacker-controlled FIFO event payload and passes it to memcpy without validation. When the length exceeds 16 bytes, the copy overruns a fixed 17-byte stack buffer (uint8_t debug_msg[17]). A malicious or compromised sensor or bus participant can trigger the overflow, causing firmware crashes, denial of service, or arbitrary code execution through adjacent stack corruption.

Critical Impact

Memory corruption on embedded firmware can lead to denial of service or arbitrary code execution on affected BHI385-based devices.

Affected Products

  • Bosch Sensortec BHI385 SensorAPI (C library)
  • Firmware integrating the bhi385_parse.c debug message parser
  • Devices consuming FIFO events through the vulnerable SensorAPI

Discovery Timeline

  • 2026-09-10 - CVE CVE-2026-42805 published to NVD
  • 2026-09-10 - Last updated in NVD database

Technical Details for CVE-2026-42805

Vulnerability Analysis

The bhi385_parse_debug_message function processes debug messages emitted through the sensor FIFO. It reads the first byte of the callback payload (callback_info->data_ptr[0]) and treats that byte as the message length. The function then invokes memcpy to copy the payload into a stack-allocated buffer sized at 17 bytes. Because the length field is neither bounds-checked nor clamped, any value between 17 and 255 produces an out-of-bounds write on the stack.

Adjacent stack data, including saved return addresses and local variables, can be overwritten by the attacker-controlled payload. On embedded targets that lack stack canaries, address space layout randomization, or non-executable stack enforcement, this corruption creates a direct path to control-flow hijacking. On hardened builds, the most likely outcome is a firmware crash producing a denial of service condition.

Root Cause

The root cause is missing input validation on an untrusted length field parsed from a sensor event buffer. The parser trusts a single attacker-controlled byte to size a memcpy destined for a fixed-size stack buffer.

Attack Vector

Exploitation requires local access to the sensor bus or the ability to compromise a bus participant that speaks to the BHI385. A crafted FIFO debug event with a length byte greater than 16 triggers the overflow. The attack does not require authentication or user interaction, but the attacker must reach the sensor communication path. Refer to the Bosch Security Advisory BOSCH-SA-223618 for vendor-supplied technical detail.

No verified public exploit code is available. The vulnerability mechanism is straightforward: supply a FIFO debug event whose first payload byte encodes a length greater than the 17-byte destination buffer, then follow it with payload bytes that overwrite adjacent stack state.

Detection Methods for CVE-2026-42805

Indicators of Compromise

  • Unexpected firmware resets or watchdog-triggered reboots on devices integrating the BHI385 sensor
  • FIFO debug events whose length byte exceeds 16 observed on the sensor bus
  • Sensor communication anomalies from peripherals not previously seen on the bus

Detection Strategies

  • Instrument firmware builds with stack canaries and log canary violations from the bhi385_parse_debug_message call path
  • Inspect sensor traffic captures for oversized debug event payloads targeting the BHI385
  • Correlate device crash telemetry with the presence of debug message FIFO events

Monitoring Recommendations

  • Monitor device health telemetry for repeated crashes localized to sensor parsing routines
  • Track supply-chain and bus topology changes that introduce untrusted peripherals near the BHI385
  • Review vendor advisories from Bosch PSIRT for updated firmware and SensorAPI releases

How to Mitigate CVE-2026-42805

Immediate Actions Required

  • Inventory all products and firmware images that link against the Bosch Sensortec BHI385 SensorAPI
  • Apply the fixed SensorAPI release referenced in Bosch Security Advisory BOSCH-SA-223618 as soon as it is available for your platform
  • Restrict physical and bus-level access to devices that expose the BHI385 to untrusted peripherals

Patch Information

Bosch has published guidance in Bosch Security Advisory BOSCH-SA-223618. Integrators should consume the corrected SensorAPI, rebuild firmware, and redeploy through their standard OTA or manufacturing update channel.

Workarounds

  • Patch the bhi385_parse_debug_message function locally to clamp the parsed length to sizeof(debug_msg) before invoking memcpy
  • Disable or gate the debug message parsing path in production firmware builds where debug FIFO events are not required
  • Enforce authentication and integrity checks on sensor bus participants where the hardware platform supports it

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.