Samsung SmartThings Hub video-core credentials Parsing SQL Injection Vulnerability
The video-core process incorrectly parses user-controlled JSON in the credentials handler, allowing JSON injection that leads to SQL injection in the video-core database. An attacker could send crafted HTTP requests to execute arbitrary SQL queries, potentially leading to code execution.
Originally disclosed on Cisco Talos
An exploitable JSON injection vulnerability exists in the credentials handler of video-core’s HTTP server of Samsung SmartThings Hub. The video-core process incorrectly parses the user-controlled JSON payload, leading to a JSON injection which in turn leads to a SQL injection in the video-core database.
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
Likely the JSON parser is configured to accept single-quoted strings, and the extracted values are inserted into a JSON string via sprintf without escaping, allowing injection of additional JSON fields that become unquoted SQL column names.
Impact
An attacker could execute arbitrary SQL queries and potentially achieve code execution on the video-core process running as root; when combined with another vulnerability, the CVSS score rises to 9.9.
What the attacker needed
Ability to impersonate remote servers or use a SmartApp; local connection to port 3000
The fix
The vendor patched the vulnerability.
How it was found
- Send a POST request to /credentials with a JSON body where a string value uses single quotes to inject additional JSON fields.
- The injected JSON fields are incorporated into the SQL UPDATE query, allowing execution of arbitrary SQL statements.
- Send a DELETE request to /cameras/123 to trigger a stack-based buffer overflow due to the overlong locationId stored in the database.
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's video service takes JSON data from a request and builds a database command without properly cleaning it. By using single quotes instead of double quotes in the JSON, an attacker can sneak extra database commands into the request. This lets them run their own database queries, which can be used to crash the service or even run code.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.