CVE-2026-42804: CWE-121 Stack-based Buffer Overflow in Bosch Sensortec BHI360_SensorAPI (C-Library)
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).
AI Analysis
Technical Summary
The Bosch Sensortec BHI360 SensorAPI C-Library contains a stack-based buffer overflow vulnerability (CWE-121) in the function bhi360_parse_debug_message() within bhi360_parse.c. The vulnerability arises because the parser trusts the first payload byte of a debug frame as the message length and copies that many bytes into a fixed 17-byte stack buffer without verifying bounds. This allows a locally or physically positioned attacker—such as one controlling a malicious sensor, counterfeit hardware module, or performing a man-in-the-middle attack on the communication bus—to inject a debug frame with a length byte greater than 16. This overflow corrupts adjacent stack data including the saved return address. Additionally, the overflowed buffer is passed to a printf-style logging function, enabling exploitation through format string specifiers like %n, which can lead to arbitrary code execution on the host microcontroller or a reliable system crash (denial of service).
Potential Impact
Successful exploitation can lead to complete compromise of the host microcontroller or SoC by executing arbitrary code with potentially high privileges. Alternatively, it can cause a denial of service by crashing the system. The vulnerability requires local or physical access to the device or communication bus, limiting remote exploitation. The CVSS 3.1 base score is 7.6 (High), reflecting high confidentiality, integrity, and availability impacts with low attack complexity but requiring physical proximity.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, mitigate risk by restricting physical and local access to the affected devices and communication buses. Avoid using untrusted or counterfeit hardware modules and sensors. Monitor vendor channels for updates and apply patches promptly once released.
CVE-2026-42804: CWE-121 Stack-based Buffer Overflow in Bosch Sensortec BHI360_SensorAPI (C-Library)
Description
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).
CVSS v3.1
Score 7.6high
Affected software
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The Bosch Sensortec BHI360 SensorAPI C-Library contains a stack-based buffer overflow vulnerability (CWE-121) in the function bhi360_parse_debug_message() within bhi360_parse.c. The vulnerability arises because the parser trusts the first payload byte of a debug frame as the message length and copies that many bytes into a fixed 17-byte stack buffer without verifying bounds. This allows a locally or physically positioned attacker—such as one controlling a malicious sensor, counterfeit hardware module, or performing a man-in-the-middle attack on the communication bus—to inject a debug frame with a length byte greater than 16. This overflow corrupts adjacent stack data including the saved return address. Additionally, the overflowed buffer is passed to a printf-style logging function, enabling exploitation through format string specifiers like %n, which can lead to arbitrary code execution on the host microcontroller or a reliable system crash (denial of service).
Potential Impact
Successful exploitation can lead to complete compromise of the host microcontroller or SoC by executing arbitrary code with potentially high privileges. Alternatively, it can cause a denial of service by crashing the system. The vulnerability requires local or physical access to the device or communication bus, limiting remote exploitation. The CVSS 3.1 base score is 7.6 (High), reflecting high confidentiality, integrity, and availability impacts with low attack complexity but requiring physical proximity.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, mitigate risk by restricting physical and local access to the affected devices and communication buses. Avoid using untrusted or counterfeit hardware modules and sensors. Monitor vendor channels for updates and apply patches promptly once released.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-6jqh-27cv-xqr6
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-42804"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6aa2af60acd9273b4925a64c
Added to database: 09/10/2026, 13:23:44 UTC
Last enriched: 09/10/2026, 13:28:59 UTC
Last updated: 09/11/2026, 09:49:40 UTC
Views: 9
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.