Skip to content
RCE Advisory Intermediate CVE-2017-2849

Foscam IP Video Camera CGIProxy.fcgi NTP Server Configuration Command Injection Vulnerability

The camera's web management service passes the user-supplied NTP server name unsanitised into a shell command that is run with popen. An authenticated administrator could inject shell characters into that parameter and run arbitrary commands on the device.

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 during NTP server configuration resulting in command injection.

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

The ntpServer value is copied into a command string with sprintf and passed to popen without any sanitisation or escaping.

Impact

An authenticated administrator could run arbitrary commands on the camera, giving full control of confidentiality, integrity and availability as reflected in the CVSS score.

What the attacker needed

Administrator account on the camera; network access to the web interface

How it was found

  1. Log in to the camera's web interface with an administrator account.
  2. Send a request to the CGIProxy.fcgi endpoint using the setSystemTime command.
  3. Set timeSource to 0 and put shell metacharacters plus the desired command in the ntpServer parameter.
  4. The device runs the injected command through popen when the NTP thread processes the setting.

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 lets an administrator choose which time server it uses to set its clock. The camera builds a text command for the operating system using that name without cleaning it first, so extra characters typed into the name become extra commands the device runs. The attacker needs to be logged in as an administrator to reach this setting.

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

185 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.