Foscam IP Video Camera CGIProxy.fcgi logOut Code Execution Vulnerability
A stack-based buffer overflow in the Foscam C1 camera's web management interface allows an authenticated attacker to overwrite the saved program counter and execute arbitrary code by sending a crafted HTTP request to the logOut CGI command. The overflow occurs because the username parameter is copied into a fixed-size buffer without proper bounds checking.
Originally disclosed on Cisco Talos
An exploitable buffer overflow vulnerability exists in the web management interface used by the Foscam C1 Indoor HD Camera running application firmware 2.52.2.43. A specially crafted HTTP request can cause a buffer overflow resulting in overwriting arbitrary data.
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 username parameter is extracted with a maximum length of 0x40 bytes but then copied into a 0x20-byte buffer using strcpy, causing a stack buffer overflow.
Impact
An attacker with a valid low-privilege account could execute arbitrary code on the device, potentially leading to full compromise.
What the attacker needed
Valid user account with at least visitor privileges; network access to the camera's web interface
How it was found
- Authenticate to the camera's web interface with at least visitor privileges.
- Send an HTTP request to the CGIProxy.fcgi endpoint with the logOut command and a specially crafted usrName parameter that exceeds the buffer size.
- The request triggers the buffer overflow, overwriting the saved program counter and register r4.
- Multiple attempts may be needed to successfully execute the desired code, such as calling system("reboot").
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.
This is a buffer overflow bug in a security camera's web interface. When you log out, the camera takes your username and copies it into a small memory space without checking if it fits. An attacker with a low-privilege account can send a very long username that spills over into other memory, letting them run their own commands on the camera.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.