Skip to content
RCE Advisory Advanced CVE-2017-2833

Foscam IP Video Camera CGIProxy.fcgi FTP Startup Configuration Command Injection Vulnerability

The camera's boot-time service builds a shell command from stored FTP account usernames and passwords without sanitising them, then runs it through the system call. An attacker with a valid account could put shell characters in a password so that arbitrary commands run when the device reboots.

Claudio Bozzato 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 resulting in command injection during the boot process.

Claudio Bozzato and another member, 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

User-controlled username and password values are inserted into a shell command string passed to system() without any sanitisation or escaping.

Impact

An authenticated attacker could execute arbitrary commands on the device with the privileges of the boot service, though the payload only runs after a reboot.

What the attacker needed

A valid user account; ability to change an account password; device reboot to trigger

How it was found

  1. Send a changePassword request to the CGIProxy endpoint with a valid account, placing shell characters in the new password.
  2. Reboot the device by other means.
  3. The injected command runs during boot when the FTP configuration script is executed.

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.

When the camera starts up, a program prepares its FTP server by running a shell command that includes the account's username and password. If those values contain special shell characters, the shell treats them as extra commands instead of plain text. Someone who can change an account password could therefore make the camera run their own command the next time it boots.

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 Claudio Bozzato

View all

8 more disclosed reports, 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.