Skip to content
RCE Advisory Advanced CVE-2018-3856

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.

Claudio Bozzato Follow

Originally disclosed on Cisco Talos

Critical 9.9 View original

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.

Claudio Bozzato, on Cisco Talos

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

  1. Obtain a valid OAuth bearer token for the SmartThings API.
  2. Send a request to api.smartthings.com to change the camera password, including ffmpeg options that write a file to /tmp/compressdump.sh.
  3. Serve the contents that will overwrite /tmp/compressdump.sh from an attacker-controlled TCP server.
  4. Send another request to change the camera password, this time writing to /tmp/ledstate to trigger a core dump.
  5. 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.

More by Claudio Bozzato

View all

185 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.