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

CUJO Smart Firewall mdnscap mDNS record parsing code execution vulnerability

A double free vulnerability in the mdnscap binary of the CUJO Smart Firewall occurs when parsing mDNS packets with an invalid query name, allowing an unauthenticated attacker to execute arbitrary code in the context of the mdnscap process.

Claudio Bozzato Follow

Originally disclosed on Cisco Talos

High 8.3 View original

An exploitable double free vulnerability exists in the mdnscap binary of the CUJO Smart Firewall. When parsing mDNS packets, a memory space is freed twice if an invalid query name is encountered, 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 code frees query_name and query_qr at the end of each loop iteration, but if parsing fails it jumps to an error path that frees them again without resetting the pointers.

Impact

An unauthenticated attacker could achieve arbitrary code execution in the context of the mdnscap process, though escaping the chroot and elevating privileges would be needed to fully compromise the device.

What the attacker needed

Network access to UDP port 5353

How it was found

  1. Craft an mDNS packet with a DNS header indicating two question entries but containing only one valid entry, or with an invalid label in the second entry.
  2. Send the packet to UDP port 5353 on the CUJO device.
  3. The mdnscap process parses the packet, fails to parse the second entry's name, and triggers a double free, crashing the process.

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.

A double free happens when a program frees the same memory twice. This can let an attacker control what the program does next, potentially running their own code. Here, sending a specially crafted network message to the device triggers the bug.

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.