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

Foscam IP Video Camera CGIProxy.fcgi Wifi Settings Code Execution Vulnerability

A stack-based buffer overflow in the setWifiSetting command of the Foscam C1 camera's CGIProxy.fcgi service allows an authenticated attacker to overwrite saved registers and potentially execute code by sending a crafted HTTP request with an overly long psk parameter.

Claudio Bozzato Follow

Originally disclosed on Cisco Talos

High 7.5 View original

An exploitable stack-based 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, potentially resulting in code execution.

Claudio Bozzato, 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 psk parameter is copied into a 0x100-byte stack buffer using strcpy without any length check, causing a stack-based buffer overflow.

Impact

An authenticated attacker could overwrite arbitrary data on the stack and potentially achieve code execution on the device.

What the attacker needed

Valid user account with privilege level 2; network access to the camera's web interface

How it was found

  1. Authenticate with a valid user account that has privilege level 2.
  2. Send an HTTP request to /cgi-bin/CGIProxy.fcgi with cmd=setWifiSetting and a psk parameter containing a long string.
  3. The psk value overflows the stack buffer and overwrites the saved r4 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 report describes a memory corruption bug in a security camera's web interface. When the camera processes a request to change Wi-Fi settings, it copies the supplied Wi-Fi password into a fixed-size memory area without checking length, so a very long password spills over into adjacent memory and can crash the device or let an attacker 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

185 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.