Samsung SmartThings Hub video-core Database find-by-cameraId Code Execution Vulnerability
A stack-based buffer overflow exists in the video-core process of the Samsung SmartThings Hub when handling a DELETE request for a camera. An attacker could exploit this to execute arbitrary code on the device.
Originally disclosed on Cisco Talos
An exploitable stack-based buffer overflow vulnerability exists in the database “find-by-cameraId” functionality of video-core’s HTTP server of Samsung SmartThings Hub. The video-core process incorrectly handles existing records inside its SQLite database, leading to a buffer overflow on the stack.
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 report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The function copies a database query result into a fixed-size stack buffer using memcpy with a length derived from strlen of the source, without any bounds checking.
Impact
An attacker could execute arbitrary code on the video-core process, which runs as root, but a local connection to the hub is needed to send the request.
What the attacker needed
Local network access to the hub; ability to insert a malicious camera record; use of TALOS-2018-0556 to set overlong value
The fix
The vendor patched the vulnerability.
How it was found
- Add a new camera with a chosen id and an overlong value in another column, using a separate vulnerability (TALOS-2018-0556).
- Send a DELETE request to the video-core HTTP server for that camera id, for example using curl from inside the hub.
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 report has not been written yet. The Original tab links to the source.
A buffer overflow happens when a program copies more data into a fixed-size memory area than it can hold, causing the extra data to spill over and potentially overwrite other important data. Here, the program copies a database value into a stack buffer without checking its length, so an attacker who can control that database value could overwrite the stack and run their own code.
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.