CVE-2023-33383 : Authentication Bypass via an outofbounds read vulnerability
A Bluetooth Low Energy write handler on the Shelly Pro 4PM trusted a length value supplied by the client, so sending more data than declared caused an out-of-bounds read and a device reset. Chained with the device's scripting feature, the reset could trigger a pre-configured script that toggles the on-board relay, even with authentication enabled.
exploitsecurity.io
Published on exploitsecurity.io
The Security Team at [exploitsecurity.io] uncovered a vulnerability in the Shelly 4PM Pro four-channel smart switch [ Firmware Version 0.11.0]. Under certain conditions the vulnerability allows an attacker to trigger an BLE out of bounds read fault condition that results in a device reload.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the BLE write handler accepted an arbitrary length written to one handle and then read that many bytes from a shorter buffer on another handle without validating the actual data size.
Impact
An attacker within Bluetooth range could crash the device and, if a script is configured, cause relays to toggle; this was noted as affecting devices with or without authentication enabled.
What the attacker needed
Bluetooth range of the device; Scripting feature configured (for relay toggle)
The fix
The firmware should validate the actual length of data written against the declared length before reading it; the text says no patch had been applied at the time of disclosure.
How it was found
- Connect to the device over BLE with a GATT client.
- Write a length value to the length handle.
- Write more data than that length to the read/write handle.
- Observe the device reset, which can trigger a configured script and toggle a relay.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
The device listens for Bluetooth messages and first asks how many bytes are coming, then reads that many. The firmware believed the stated length without checking the actual data, so a mismatched message made it read past the end of its buffer and crash. Because a crash can fire an automation script, the attacker could make a relay switch on or off.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.