Skip to content
RCE Advisory Intermediate CVE-2017-2845

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.

Cory Duplantis Follow

Originally disclosed on Cisco Talos

High 8.8 View original

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…

Cory Duplantis and Claudio Bozzato, on Cisco Talos

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

  1. Send an HTTP request to the CGIProxy.fcgi service invoking the smtpTest command.
  2. Supply a sender value containing shell metacharacters alongside the other SMTP parameters.
  3. The service forwards the parameters and builds the msmtp command with the unsanitised sender value.
  4. 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.

More by Cory Duplantis

View all

1 more disclosed report, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.