Skip to content
Memory corruption Advisory Advanced CVE-2018-3902

Samsung SmartThings Hub video-core Camera URL Replace Code Execution Vulnerability

The video-core HTTP server on the Samsung SmartThings Hub copies the user-supplied 'url' JSON field into a fixed-size stack buffer without checking its length, causing a stack buffer overflow. An attacker who can send a request to the local video-core service could overwrite the saved program counter and execute arbitrary code as root.

Claudio Bozzato Follow

Originally disclosed on Cisco Talos

Critical 9.9 View original

An exploitable buffer overflow vulnerability exists in the camera “replace” feature of video-core’s HTTP server of Samsung SmartThings Hub. The video-core process incorrectly extracts the URL field from a user-controlled JSON payload, leading to a buffer overflow on the stack.

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 code uses memcpy with a length equal to strlen of the user-controlled JSON string, copying it into a fixed-size stack buffer without any bounds check.

Impact

An attacker could achieve code execution on the video-core process, which runs as root, potentially compromising the hub; exploitation is made reliable by low ASLR entropy and multiple threads with large stacks.

What the attacker needed

Ability to send HTTP requests to video-core on…; impersonate remote SmartThings servers or run a SmartApp

The fix

The vendor patched the vulnerability.

How it was found

  1. Send a PUT request to /cameras/<camera-id> on the video-core HTTP server with a JSON body containing cameraId, locationId, dni, and a very long url field.
  2. The server parses the JSON and copies the url string into a stack buffer using memcpy with the string's own length, overflowing the buffer.
  3. The overflow overwrites the saved program counter and other stack data, allowing control of execution flow.

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, so the extra data spills over and can overwrite nearby instructions. Here, the video-core service takes a URL from a JSON request and copies it into a small stack buffer without checking how long it is. An attacker who can reach that service can send a very long URL and take control of the program.

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.

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.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.