Skip to content
Memory corruption Advisory Advanced CVE-2018-3898CVE-2018-3899

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

The QR code parsing function in Yi Home Camera uses an unbounded sscanf to copy the SSID and password fields into fixed-size stack buffers, allowing a crafted QR code to overflow the stack and overwrite the return address. An attacker could achieve code execution by convincing a user to show the camera a malicious QR code.

Lilith Follow

Originally disclosed on Cisco Talos

High 8.3 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 (/^o^)/, 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_info function uses sscanf with a format that does not limit the number of characters copied into fixed-size stack buffers.

What the attacker needed

Attacker can make camera scan a QR code; victim shows malicious QR code to camera

The fix

The issue was fixed by the vendor, as confirmed by Talos and a new firmware release.

How it was found

  1. Generate a QR code containing a long value for the SSID or password field.
  2. Show the QR code to the camera during setup or when it scans codes.
  3. The camera parses the QR code and overflows the stack buffer.
  4. When the function returns, the overwritten return address leads 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.

The camera reads a QR code and copies parts of it into small memory boxes on the stack without checking length. A very long value spills over into nearby memory, including the return address that tells the program where to go next. An attacker can use this to run their own code 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 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.