Samsung SmartThings Hub video-core RTSP Configuration Command Injection Vulnerability
The Samsung SmartThings Hub's video-core process builds an ffmpeg command line by splitting a stored camera URL on spaces, so a space in the camera password lets an attacker inject extra ffmpeg options. This can be used to write files and execute arbitrary commands, leading to full compromise of the device.
Originally disclosed on Cisco Talos
An exploitable vulnerability exists in the smart cameras RTSP configuration of the Samsung SmartThings Hub. The device incorrectly handles spaces in the URL field, leading to an arbitrary operating system command injection.
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 video-core process constructs an ffmpeg argument string by concatenating user-controlled values and then splits it on spaces with strtok, so a space in the camera password becomes an argument separator and allows injection of additional ffmpeg options.
Impact
An attacker could execute arbitrary shell commands, resulting in a complete compromise of the device; the text notes that most system partitions are read-only, so the proof of concept overwrites two files in /tmp to achieve execution.
What the attacker needed
Valid OAuth bearer token; a camera set up on the hub; attacker can reach api.smartthings.com
The fix
The vendor patched the vulnerability.
How it was found
- Obtain a valid OAuth bearer token for the SmartThings API.
- Send a request to api.smartthings.com to change the camera password, including ffmpeg options that write a file to /tmp/compressdump.sh.
- Serve the contents that will overwrite /tmp/compressdump.sh from an attacker-controlled TCP server.
- Send another request to change the camera password, this time writing to /tmp/ledstate to trigger a core dump.
- Serve a string that crashes the ledd process, causing the core dump and executing the overwritten script.
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.
The hub runs a program called ffmpeg to connect to a smart camera. It builds the list of options for ffmpeg by joining pieces of text with spaces and then splitting them again on spaces. If an attacker puts a space in the camera password, the hub treats the text after the space as extra ffmpeg options, which can be abused to run commands on the device.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.