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.
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 NTP server configuration resulting in command injection.
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
- Log in to the camera's web interface with an administrator account.
- Send a request to the CGIProxy.fcgi endpoint using the setSystemTime command.
- Set timeSource to 0 and put shell metacharacters plus the desired command in the ntpServer parameter.
- 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.