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.
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.
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
- Generate a QR code containing a long value for the SSID or password field.
- Show the QR code to the camera during setup or when it scans codes.
- The camera parses the QR code and overflows the stack buffer.
- 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.