Foscam IP Video Camera CGIProxy.fcgi Firmware Upgrade Code Execution Vulnerability
The Foscam C1 camera's firmware upgrade process lacks signature verification and uses a hardcoded AES key, allowing an authenticated administrator to upload a crafted image that executes arbitrary commands as root. An attacker with administrator credentials could run custom binaries and replace the firmware.
Originally disclosed on Cisco Talos
Insufficient security checks exist in the recovery procedure used by the Foscam C1 Indoor HD Camera running application firmware 2.52.2.43. A HTTP request can allow for a user to perform a firmware upgrade using a crafted image.
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
Impact
An attacker with administrator credentials could execute arbitrary commands as root and replace the device firmware.
What the attacker needed
Valid administrator account
How it was found
- Send an HTTP multipart request to the CGIProxy.fcgi endpoint with the fwUpgrade command and valid administrator credentials.
- The uploaded image is stored as /tmp/upgrade.bin and passed to the FirmwareUpgrade binary.
- The image is decrypted with a hardcoded AES key and extracted as a tar archive.
- The extracted WriteFlash binary and configuration files are executed via system() calls, running commands as root.
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 camera lets an administrator update its software by uploading a file. The camera does not check that the file really comes from the manufacturer, and the password used to unlock the file is built into the camera. So someone who knows that password can make their own update file that runs harmful commands on the camera with the highest permissions.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.