Foscam IP Video Camera CGIProxy.fcgi SMTP Test User Parameter Configuration Command Injection Vulnerability
A command injection vulnerability exists in the Foscam C1 camera's web management interface, where a specially crafted HTTP request can inject arbitrary data into the msmtprc configuration file, leading to command execution. An attacker can send an HTTP request to the device to trigger this vulnerability.
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 'user' parameter from the smtpTest request is written directly into the msmtprc configuration file without sanitisation, allowing injection of configuration directives that lead to command execution.
Impact
An attacker could execute arbitrary commands on the device, potentially leading to full compromise.
What the attacker needed
Access to the camera's web interface; authentication may be required
How it was found
- Send an HTTP request to the CGIProxy.fcgi service with the smtpTest command.
- Include a crafted 'user' parameter containing malicious data.
- The camera writes the unsanitised 'user' value into /usr/local/etc/msmtprc.
- The injected configuration causes command execution when msmtp is invoked.
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 has a web page for settings. One setting lets you test an email server. The camera saves the email username you type into a configuration file without cleaning it. Because of that, someone who can reach the camera's web interface can sneak in extra commands that the camera will run.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.