Skip to content
Memory corruption Advisory Advanced CVE-2017-2830

Foscam IP Video Camera CGIProxy.fcgi Message 0x3001 Multi-part Form Boundary Code Execution Vulnerability

A stack-based buffer overflow exists in the Foscam C1 camera's CGIProxy.fcgi service when handling a multipart/form-data request with an overly long boundary string. An attacker could send a crafted HTTP request to overwrite stack memory, potentially leading to code execution.

Claudio Bozzato Follow

Originally disclosed on Cisco Talos

High 8.8 View original

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.37. A specially crafted HTTP request can cause a buffer overflow resulting in overwriting arbitrary data.

Claudio Bozzato and another member, on Cisco Talos

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 service uses strcpy to copy the multipart boundary string into a 0x100-byte stack buffer without any length check, allowing a longer boundary to overflow the buffer and overwrite the saved link register.

What the attacker needed

Valid username and password; network access to the camera's web interface

How it was found

  1. Send an HTTP POST request to the CGIProxy.fcgi endpoint with a command parameter set to usrBeatHeart and valid credentials.
  2. Set the Content-Type header to multipart/form-data with a boundary parameter that is longer than 0x100 bytes.
  3. Include a multipart body that contains the same overly long boundary string.
  4. The service copies the boundary into a fixed-size stack buffer, overflowing it and overwriting the saved link register.

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 memory corruption bug in a security camera's web interface. When the camera processes a file upload request, it copies a part of the request called the 'boundary' into a fixed-size memory area without checking its length. If the boundary is too long, it spills over into adjacent memory, which an attacker could use to crash the device or run their own code.

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.

More by Claudio Bozzato

View all

8 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.