Samsung SmartThings Hub video-core samsungWifiScan Callback Code Execution Vulnerability
The video-core process on the Samsung SmartThings Hub has a stack-based buffer overflow when handling the response from a smart camera during a WiFi scan. An attacker who can send HTTP requests to the local video-core server can trigger the overflow and potentially execute arbitrary code as root.
Originally disclosed on Cisco Talos
An exploitable stack-based buffer overflow vulnerability exists in the samsungWifiScan callback notification of video-core’s HTTP server of Samsung SmartThings Hub. The video-core process incorrectly handles the answer received from a smart camera, 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 code uses sprintf to copy the smart camera's HTTP response into a fixed-size stack buffer without any length check.
Impact
An attacker could execute arbitrary code as root on the video-core process, but they must first be able to send HTTP requests to the localhost-only server, either by impersonating the remote SmartThings servers or via a SmartApp.
What the attacker needed
Ability to send HTTP requests to localhost:3000; control over a server that responds to the camera request
The fix
The vendor patched the vulnerability, likely by adding bounds checking to the sprintf call.
How it was found
- Send a POST request to the local video-core HTTP server on port 3000 at the /samsungWifiScan path, specifying a camera IP and a callback URL.
- video-core sends an HTTP GET request to the specified camera IP to perform a WiFi scan.
- The attacker-controlled server responds with an overly long HTTP response.
- video-core copies that response into a fixed-size stack buffer using sprintf, causing a buffer overflow and crashing the process.
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 small program on the hub that handles camera responses copies the camera's reply into a fixed-size memory area without checking its length. If the reply is too long, it spills over into other memory and can crash the program or let an attacker run their own code. The attacker needs a way to send requests to that program, which normally only accepts connections from the hub itself.
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.