CVE-2026-141511 PUBLISHED

Mongoose: Out-of-Bounds Read in mg_mqtt_next_topic() Leading to Denial of Service

Assigner: GitHub_M
Reserved: 01.12.2026 Published: 01.12.2026 Updated: 01.12.2026

Mongoose is an embedded web server and network library. Prior to 7.22, the Mongoose MQTT broker tutorial's mg_mqtt_next_topic() function can read two bytes beyond msg->dgram.len when a malformed MQTT SUBSCRIBE packet supplies a topic position that does not leave enough bytes for the topic-length field. Because tutorials/mqtt/mqtt-server/main.c reads that field without validating the complete two-byte access against the datagram boundary, an unauthenticated remote MQTT client can trigger invalid memory access and crash the broker. This issue is fixed in 7.22.

Metrics

CVSS Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
CVSS Score: 8.7

Product Status

Vendor cesanta
Product mongoose
Versions
  • Version < 7.22 is affected

References

Problem Types

  • CWE-125: Out-of-bounds Read CWE