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.
Originally disclosed on Cisco Talos
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…
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
- Send an HTTP request to the CGIProxy.fcgi endpoint with the setIpInfo command and valid administrator credentials.
- Set isDHCP to 0 so the manual configuration branch is taken.
- Supply ip, mask, dns1 and dns2 values, and put shell metacharacters plus a command into the gate parameter.
- 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.