Foscam IP Video Camera CGIProxy.fcgi Account Creation Command Injection Vulnerability
The camera's account creation command builds a shell command from the supplied user name and password without properly neutralising shell metacharacters, so an authenticated user can inject commands. An attacker with valid credentials could run arbitrary shell 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 account creation 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
Likely the user name and password are formatted into a shell command string passed to system() with only a check for semicolons in the password, leaving other shell metacharacters usable.
Impact
An authenticated attacker could execute arbitrary shell commands on the camera, giving high confidentiality and integrity impact.
What the attacker needed
Valid credentials with user-creation rights; network access to the camera web interface
How it was found
- Log in to the camera with an account that has privileges to create users.
- Send an addAccount request to the CGI proxy with a crafted user name containing shell characters.
- The device builds and runs the configFTP shell 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's web interface takes the name and password you type when creating an account and pastes them into a command it runs on the device's operating system. Because it does not clean up special characters, someone who is already logged in can sneak extra commands into those fields and have the camera run them.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.