amqtt is vulnerable to a remote denial of service caused by incomplete MQTT QoS 2 transactions remaining allocated after the associated client disconnects.
MQTT QoS 2 uses a four-step handshake to provide exactly-once delivery. If a client begins a QoS 2 transaction but disconnects before the handshake completes, amqtt retains the associated transaction state and packet identifier without an expiration mechanism to remove it.
QoS 1 transactions are protected by a timeout mechanism, which defaults to 5 seconds, allowing abandoned state to be released. Equivalent timeout handling was not applied to incomplete QoS 2 transactions.
An attacker can repeatedly connect to the broker, initiate QoS 2 transactions, and disconnect before completing the handshake. Each incomplete transaction leaves state allocated in memory. Repeating this process causes broker memory consumption to grow continuously.
Successful exploitation can cause:
Exploitation does not require maintaining long-lived connections. An attacker can create incomplete QoS 2 transactions and disconnect, leaving the broker to retain the associated state after the network connection has closed.
Under the default configuration, anonymous clients can exploit the vulnerability without credentials. When authentication is enabled, any authenticated client permitted to initiate QoS 2 message flows may still be able to exploit it. Authentication alone is therefore not a sufficient mitigation.
pipamqtt>= 0.11.0, <= 0.12.0The vulnerable code is present in the v0.11.0 release commit,...
0.12.1Exploitability
AV:NAC:LPR:NUI:NScope
S:UImpact
C:NI:NA:H7.5/CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HOther
Resource Management