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

Foscam IP Video Camera devMng Multi-Camera Port 10000 Command 0x0002 Password Field Code Execution Vulnerability

The devMng binary on the Foscam C1 camera copies the username field from a Multi-Camera discovery message into a fixed-size stack buffer with an unbounded string copy, so an oversized field overflows the stack. An unauthenticated attacker on the network could overwrite saved data such as the return address and execute arbitrary code.

Claudio Bozzato Follow

Originally disclosed on Cisco Talos

High 8.8 View original

An exploitable buffer overflow vulnerability exists in the Multi-Camera interface used by the Foscam C1 Indoor HD Camera running application firmware 2.52.2.43. A specially crafted request on port 10000 can cause a buffer overflow resulting in overwriting arbitrary data.

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 username field from the network message is copied with strcpy into a stack buffer smaller than the maximum message length, with no bounds check.

Impact

An unauthenticated attacker who can reach the camera on the network could overwrite stack data and execute arbitrary code, as demonstrated by a proof of concept that reboots the device.

What the attacker needed

Network access to UDP port 10000; knowledge of the camera's MAC address; no authentication needed

How it was found

  1. Send a UDP message to port 10000 containing the MO_I header and the discovery command identifier 0x0002.
  2. Include the correct MAC address of the target camera so the message passes the MAC check.
  3. Supply an oversized username field so the copy overflows the stack buffer.
  4. Craft the overflow so the saved program counter is overwritten with the chosen address.

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 runs a small program that listens for messages from other cameras on the local network. When it reads the username from such a message, it copies it into a small reserved space in memory without checking how long it is, so a long username spills over into neighbouring memory. By carefully choosing what spills over, an attacker can change where the program goes next and make it run their own instructions.

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.