Samsung SmartThings Hub video-core Camera Creation Code Execution Vulnerability
The video-core HTTP server on the Samsung SmartThings Hub copies the user-supplied 'state' JSON field into a fixed-size stack buffer without checking its length, causing a stack buffer overflow. An attacker who can send requests to the localhost service could crash the process and potentially execute arbitrary code as root.
Originally disclosed on Cisco Talos
An exploitable buffer overflow vulnerability exists in the camera “create” feature of video-core’s HTTP server of Samsung SmartThings Hub. The video-core process incorrectly extracts the “state” field from a user-controlled JSON payload, 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 'state' parameter is copied into a stack buffer using memcpy with a length derived from strlen of the user-controlled input, without any bounds check.
Impact
An attacker could crash the video-core process and potentially execute arbitrary code with root privileges, but exploitation requires the ability to send requests to the localhost service, such as by impersonating the remote servers or via a SmartApp.
What the attacker needed
Ability to send HTTP requests to localhost:3000; impersonate remote servers or use a SmartApp
The fix
The 'state' parameter should be validated or its length limited before copying, as was done for other parameters.
How it was found
- Send a POST request to the /cameras endpoint on the video-core HTTP server (localhost port 3000).
- Include a JSON body with the required fields cameraId, locationId, dni, url, and a 'state' field containing a long string.
- The server parses the JSON and copies the 'state' value into a stack buffer without length validation, causing a crash or potential code execution.
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 space than it can hold, spilling over into nearby memory. Here, the camera-creation feature takes a text field from a request and copies it without checking its size, so a very long value can overwrite important data and crash the program or let an attacker 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.