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

Yi Technology Home Camera 27US TimeSync Code Execution Vulnerability

The camera's time sync routine reads a JSON field from an HTTP response into a fixed-size stack buffer without length checks, allowing a stack buffer overflow. An attacker who can intercept and alter network traffic could overflow into a command buffer and execute arbitrary commands.

Lilith Follow

Originally disclosed on Cisco Talos

Critical 9.6 View original

An exploitable firmware downgrade vulnerability exists in the time syncing functionality of Yi Home Camera 27US 1.8.7.0D. A specially crafted packet can cause a buffer overflow, resulting in code execution.

Lilith (>_>), 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 trans_json function copies the value of the JSON 'code' field into a fixed-size stack buffer using sscanf with no length limit, and the overflowed data lands in a command buffer that is later passed to popen.

Impact

An attacker positioned to intercept network traffic could execute arbitrary commands on the camera, though the response size is limited to 0x800 bytes.

What the attacker needed

Attacker can intercept and alter network traffic; camera performs time sync over HTTP

The fix

The issue was fixed by the vendor in a new firmware release.

How it was found

  1. Intercept the camera's HTTP time sync request to the cloud API.
  2. Return a response whose JSON 'code' value is longer than the destination buffer.
  3. The oversized value overflows into the command buffer used by popen.
  4. The camera executes the overflowed string as a shell command.

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 camera asks a server for the time over an unencrypted connection. It copies part of the reply into a small space on its memory without checking how long it is, so a long reply spills over into other memory. Because that spilled data later gets run as a system command, an attacker who can tamper with the network traffic can run their own commands on the camera.

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 Lilith

View all

6 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.