Skip to content
RCE Advisory Advanced CVE-2017-2846

Foscam IP Video Camera CGIProxy.fcgi Gateway Address Configuration Command Injection Vulnerability

The camera's network configuration handler passes the user-supplied gateway address into a shell command without sanitising it, so shell metacharacters in that field are executed. An authenticated administrator could 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 manual network configuration resulting in command…

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 gateway value is copied unmodified into a shell command string built with sprintf and run through sh -c, so shell metacharacters are interpreted rather than treated as data.

Impact

An authenticated administrator could execute arbitrary commands on the camera, giving full control of the device.

What the attacker needed

Valid administrator account on the camera; network access to the camera's web interface

How it was found

  1. Send an HTTP request to the CGIProxy.fcgi endpoint with the setIpInfo command and valid administrator credentials.
  2. Set isDHCP to 0 so the manual configuration branch is taken.
  3. Supply ip, mask, dns1 and dns2 values, and put shell metacharacters plus a command into the gate parameter.
  4. The device saves the parameters and later the polling thread builds and runs the gateway command, executing the injected command.

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 set network details such as the gateway address. Instead of treating that address as plain text, the software pastes it into a command it hands to the operating system's shell, which also interprets special characters. Adding extra shell characters therefore makes the camera run commands the attacker chose.

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.