CVE-2023-3592 in Mosquittoinfo

Summary

by MITRE • 10/25/2023

In Mosquitto before 2.0.16, a memory leak occurs when clients send v5 CONNECT packets with a will message that contains invalid property types.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 10/25/2023

The vulnerability identified as CVE-2023-3592 affects the Mosquitto MQTT broker software version 2.0.15 and earlier, representing a memory leak condition that can be exploited through malformed v5 CONNECT packets. This issue specifically targets the handling of will messages within the MQTT version 5.0 protocol implementation, where the broker fails to properly validate property types in will message constructs. The flaw exists in the protocol parsing logic that processes client connection requests, creating a scenario where memory allocation occurs without subsequent deallocation when invalid property types are encountered in will message properties.

The technical implementation of this vulnerability stems from inadequate input validation within the Mosquitto broker's MQTT v5.0 parser. When a client establishes a connection using the v5 protocol and includes a will message with malformed property types, the broker's memory management system allocates memory for processing these properties but fails to properly clean up the allocated resources. This memory allocation occurs during the CONNECT packet processing phase, where the broker attempts to validate and store will message properties before establishing the client session. The failure to properly handle invalid property types leads to a gradual accumulation of unreleased memory segments, which can eventually result in memory exhaustion and service disruption.

From an operational perspective, this vulnerability presents a significant risk to MQTT broker deployments that support MQTT v5.0 protocol connections, particularly in environments where multiple clients frequently connect and disconnect or where the broker serves as a critical messaging infrastructure component. The memory leak can be exploited through a single malicious client connection attempt, making it a low-effort, high-impact vulnerability for attackers seeking to cause denial of service conditions. The cumulative nature of the memory leak means that prolonged exploitation can lead to complete broker unavailability, affecting all connected clients and potentially disrupting critical IoT or industrial control systems that rely on MQTT messaging.

The vulnerability aligns with CWE-401, which describes improper handling of memory allocation failures, and can be mapped to ATT&CK technique T1499.004 for network denial of service attacks. Organizations using Mosquitto brokers should prioritize updating to version 2.0.16 or later, which includes patches addressing the memory leak through improved property validation and proper memory cleanup procedures. Additional mitigations include implementing connection rate limiting, monitoring memory consumption patterns, and deploying network segmentation to limit exposure. The fix implemented by the Mosquitto development team involves strengthening the validation logic for will message properties and ensuring that all allocated memory is properly deallocated regardless of property validity, addressing the root cause of the memory leak condition that existed in earlier versions of the software.

Responsible

Eclipse Foundation

Reservation

07/10/2023

Disclosure

10/25/2023

Moderation

accepted

CPE

ready

EPSS

0.00675

KEV

no

Activities

very low

Sources

Want to know what is going to be exploited?

We predict KEV entries!