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

Yi Technology Home Camera 27US QR Code Base64 Code Execution Vulnerability

A stack-based buffer overflow in the QR code parsing of the Yi Home Camera allows an attacker to execute arbitrary code by supplying a specially crafted QR code. The camera scans the QR code, and the vulnerable base64 decoding function writes beyond its intended buffer, potentially overwriting the return address.

Lilith Follow

Originally disclosed on Cisco Talos

Critical 9.1 View original

An exploitable code execution vulnerability exists in the QR code scanning functionality of Yi Home Camera 27US 1.8.7.0D. A specially crafted QR Code 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 base64 decoding function lacks output size constraints and can write beyond the intended stack buffer when processing input without '=' or null characters.

What the attacker needed

Attacker can supply a QR code; victim scans the QR code with the camera; or server sends malicious bindkey

The fix

The vulnerability was fixed by the vendor in a firmware update.

How it was found

  1. The attacker creates a QR code containing a specially crafted string with base64-encoded data that lacks '=' or null characters.
  2. The attacker convinces the victim to show this QR code to the camera, or the server sends a malicious bindkey containing '&p='.
  3. The camera scans the QR code and parses the string, extracting the password field.
  4. The password field is base64 decoded, and due to the lack of bounds checking, the decoding process continues beyond the intended buffer, overwriting the return address on the stack.
  5. When the function returns, the overwritten return address is used, leading to code execution.

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.

This is a security flaw in a home security camera. When you set up the camera, you show it a QR code to connect to your Wi-Fi. The camera reads the code and processes the data, but it doesn't check if the data is too long. An attacker can make a malicious QR code that, when scanned, causes the camera to run the attacker's code, giving them control over the device.

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.