Foscam IP Video Camera CGIProxy.fcgi SMTP Test Host Parameter Configuration Command Injection Vulnerability
A command injection vulnerability exists in the Foscam C1 camera's web interface, where the smtpTest command writes user-supplied parameters into the msmtprc configuration file without sanitisation. An attacker can inject arbitrary data to execute commands on the device.
Originally disclosed on Cisco Talos
An exploitable command injection vulnerability exists in the web management interface used by the Foscam C1 Indoor HD Camera running application firmware 2.52.2.37. A specially crafted HTTP request can allow for a user to inject arbitrary data in the “msmtprc” configuration file resulting in command 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 smtpServer parameter is written directly into the msmtprc configuration file without any sanitisation, allowing an attacker to inject arbitrary configuration lines that lead to command execution.
Impact
An attacker could execute arbitrary commands on the camera, potentially gaining full control of the device.
What the attacker needed
Network access to the camera's web interface; valid credentials (PR:L per CVSS)
How it was found
- Send an HTTP request to the camera's web interface invoking the smtpTest command.
- Provide a crafted smtpServer parameter containing injected data.
- The camera writes the unsanitised value into /usr/local/etc/msmtprc.
- The injected configuration causes command execution on the device.
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's web interface lets you test email settings. When you enter the mail server address, the camera saves it into a configuration file without cleaning it up. Because of that, someone can sneak in extra instructions that the camera later runs as system commands, taking over the device.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.