Skip to content
RCE Advisory Intermediate CVE-2017-2847

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

The camera's setIpInfo command takes the dns1 parameter and inserts it unsanitised into a shell command that writes the DNS server into the resolver configuration. An authenticated administrator could inject shell metacharacters so that arbitrary commands run 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

User-supplied dns1 is formatted into a shell command string with sprintf and handed to a shell via execlp without any sanitisation or validation.

Impact

An authenticated administrator could execute arbitrary commands on the camera, giving high confidentiality and integrity impact, though the attacker already needs admin credentials.

What the attacker needed

Valid administrator account; manual (non-DHCP) network configuration

How it was found

  1. Log in with a valid administrator account and send a setIpInfo request with isDHCP set to 0.
  2. Supply valid ip, mask and gateway values so parsing succeeds.
  3. Put shell metacharacters and an extra command into the dns1 parameter.
  4. The device stores the parameters and later builds a shell command from dns1.
  5. The shell runs the injected command on the camera.

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 admin change its network settings through a web request. One of those settings, the DNS server address, is pasted straight into a command the camera runs in its own operating system shell. Because special shell characters are not removed, someone who can log in as admin can add extra commands that the camera then executes.

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.