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

Published Dec 1, 2026
·
Updated

Mongoose is an embedded web server and network library. Prior to 7.22, the Mongoose MQTT broker tutorial's mgmqttnexttopic() 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.

Affected Software

1 affected component
Mongoose Mongoose<7.22

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Mongoose to a version that resolves this vulnerability.

    Fixed in 7.22

Event History

Dec 1, 2026
CVE Published
via MITRE·08:33 PM
Data Sourced
via MITRE·08:33 PM
DescriptionWeakness
Data Sourced
via OSV·08:33 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed?

Deployments using the Mongoose MQTT broker tutorial code in versions prior to 7.22 are affected. The issue is in tutorials/mqtt/mqtt-server/main.c, not described as affecting every use of the Mongoose library.

2

What does an attacker need to exploit this?

An unauthenticated remote MQTT client only needs to send a malformed MQTT SUBSCRIBE packet with a topic position that leaves fewer than two bytes for the topic-length field. Successful exploitation can cause invalid memory access and crash the broker.

3

Is authentication required?

No. The described attack can be performed by an unauthenticated remote MQTT client.

4

What should be done if the broker cannot be upgraded immediately?

The provided data identifies version 7.22 as the fix. Until upgrading, restrict remote MQTT client access to reduce exposure to malicious malformed SUBSCRIBE packets.

5

How can I determine whether my deployment is affected?

Check whether your application uses the MQTT broker tutorial implementation, specifically tutorials/mqtt/mqtt-server/main.c, and whether it is based on a Mongoose release earlier than 7.22.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203