Skip to content
Memory corruption Advisory Advanced CVE-2018-4003

CUJO Smart Firewall mdnscap mDNS character-strings code execution vulnerability

The mdnscap binary of CUJO Smart Firewall mishandles string lengths when parsing character-strings in mDNS resource records, causing a heap buffer overflow. An unauthenticated attacker can send a crafted mDNS message to achieve arbitrary code execution in the context of the mdnscap process.

Claudio Bozzato Follow

Originally disclosed on Cisco Talos

High 8.3 View original

An exploitable heap overflow vulnerability exists in the mdnscap binary of the CUJO Smart Firewall running firmware 7003. The string lengths are handled incorrectly when parsing character strings in mDNS resource records, leading to arbitrary code execution in the context of the mdnscap process.

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 length check in collect_strings only compares each character-string's length against the total rdlength, ignoring the cumulative length of all strings plus separators and the null terminator, so the buffer allocated with rdlength+1 bytes can be overflowed.

Impact

An unauthenticated attacker could achieve arbitrary code execution in the context of the mdnscap process, but would need to escape the chroot and elevate privileges to fully compromise the device.

What the attacker needed

Network access to UDP port 5353; no authentication required

How it was found

  1. Craft an mDNS response packet with QR=1 and TC=0, containing an answer record of type SRV (33) with a declared RDLENGTH smaller than the sum of the character-string lengths.
  2. Send the packet to UDP port 5353 on the CUJO device.
  3. The mdnscap process parses the packet, calls collect_strings, and overflows the heap buffer, causing a crash or potential code execution.

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 firewall runs a small program that listens for mDNS (a protocol used by devices to announce themselves on a local network). When it reads a message, it copies text into a fixed-size memory area without checking the total length properly. By sending a specially crafted message, an attacker can overflow that memory area and potentially run their own code on the device.

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.