Skip to content
Info disclosure Advisory Intermediate CVE-2017-2895

Cesanta Mongoose MQTT SUBSCRIBE Topic Length Information Leak

The MQTT SUBSCRIBE packet parser trusts the topic length field without validating it against the actual buffer size, leading to an out-of-bounds read. An attacker can send a crafted packet to leak memory or cause a denial of service.

Aleksandar Nikolic Follow

Originally disclosed on Cisco Talos

High 8.2 View original

An exploitable arbitrary memory read vulnerability exists in the MQTT packet parsing functionality of Cesanta Mongoose 6.8. A specially crafted MQTT SUBSCRIBE packet can cause an arbitrary out-of=bounds memory read potentially resulting in information disclosure and denial of service.

Aleksandar Nikolic, 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 topic length field from the packet is used directly in pointer arithmetic without verifying it fits within the payload buffer.

Impact

An attacker could leak memory contents and cause a denial of service by crashing the broker.

What the attacker needed

Network access to MQTT broker

How it was found

  1. Send a specially crafted MQTT SUBSCRIBE packet to the mqtt_broker application.
  2. The packet contains a topic length that exceeds the actual payload size.
  3. The parser reads the QoS byte at an offset beyond the buffer, causing an out-of-bounds read.

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.

When a program reads a message, it should check that the message is long enough before using a length value from it. Here, the program used a length from the message to jump ahead in memory without checking, so it could read data outside the message. This could let an attacker see memory contents or crash the program.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by Aleksandar Nikolic

View all

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

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.