Foscam IP Video Camera CGIProxy.fcgi SMTP Test Command Injection Vulnerability
The camera's web management service builds a shell command for an SMTP test using the user-supplied sender address without sanitising it, so an authenticated user can inject shell characters and run arbitrary commands on the device. An attacker who can send the crafted HTTP request gains command execution as the service.
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 shell characters during the SMTP configuration tests resulting in command…
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
Likely the sender parameter is concatenated into a shell command string passed to system() without any sanitisation or escaping.
Impact
An authenticated attacker could execute arbitrary shell commands on the camera, leading to full compromise of confidentiality, integrity and availability.
What the attacker needed
Access to the web management interface; valid credentials (PR:L per CVSS)
How it was found
- Send an HTTP request to the CGIProxy.fcgi service invoking the smtpTest command.
- Supply a sender value containing shell metacharacters alongside the other SMTP parameters.
- The service forwards the parameters and builds the msmtp command with the unsanitised sender value.
- The command is executed via system, running the injected shell commands 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.
The camera has a web page that lets you test email settings. To send the test email it runs a system command, and it pastes your 'sender' email address straight into that command. If you put special shell characters in that field, the camera runs your extra commands too, so you can take control of 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.