Foscam IP Video Camera CGIProxy.fcgi Account Password Command Injection Vulnerability
The camera's password-change handler builds a shell command from the new password and only rejects semicolons, so other shell metacharacters pass through. An authenticated user could inject extra shell commands that run 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 a password change 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 new password is placed into a shell command string and only the semicolon is filtered, so other shell metacharacters still allow command injection.
Impact
An authenticated user with access level 2 could run arbitrary shell commands on the camera, giving high confidentiality and integrity impact.
What the attacker needed
Valid user account; access level 2; network access to the camera
How it was found
- Send an HTTP request to the camera's CGI proxy with the changePassword command.
- Supply a valid user name, the old password and a new password containing shell metacharacters.
- The device builds the password-change shell command and runs it, executing the injected commands.
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 changes a password by handing a command to the operating system's shell, a program that runs typed commands. It pasted the new password straight into that command and only blocked one dangerous character, the semicolon. Other characters still let someone add their own commands, which then run on the camera.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.