Yi Technology Home Camera 27US Firmware Update Code Execution Vulnerability
The firmware update process on the Yi Home Camera fails to properly validate the decrypted key, allowing an attacker to inject shell commands via a crafted firmware file on an SD card. This leads to arbitrary command execution with the privileges of the update process.
Originally disclosed on Cisco Talos
An exploitable code execution vulnerability exists in the firmware update functionality of Yi Home Camera 27US 1.8.7.0D. A specially crafted file can cause a logic flaw and command injection, 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 update script does not validate the decrypted key before using it in a shell command, and the decryption routine can be bypassed to control the key.
Impact
An attacker with physical access to insert an SD card could execute arbitrary commands on the camera, potentially compromising the device.
What the attacker needed
Physical access to insert SD card; crafted firmware file on SD card
The fix
The issue was fixed by the vendor in a later firmware release.
How it was found
- Insert an SD card containing a crafted home_y18m file into the camera.
- The camera's init script detects the file and runs the update script.
- The update script extracts the version, encrypted key, and remaining data.
- The rsa_pub_dec binary fails to decrypt properly and writes user-controlled data to dec_enc_key.
- The script constructs home3 from dec_enc_key and home2, then extracts the key field.
- The key is passed to exthome, which runs 7za with the key as a password, allowing command injection.
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's firmware update reads a file from an SD card and uses part of it as a password for a decompression tool. Because the password is not checked, an attacker can put special characters in it that make the tool run other commands. This lets someone with physical access to the SD card run their own code on the camera.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.