CVE-2026-54412
JSON

7.8high

MQTT-C Heap Out-of-Bounds Read and Integer Underflow in mqtt_unpack_publish_response()

Severity
7.8high CVSS:4.0 by TuranSec
Exploit likelihood
0.43% (higher than 39% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
TuranSec

Description

LiamBindle MQTT-C versions prior to 1.1.7 contain a heap-based out-of-bounds read and integer underflow in the mqtt_unpack_publish_response() function in src/mqtt.c. A remote unauthenticated attacker controlling an MQTT broker, or capable of injecting MQTT traffic into an unencrypted session, can crash a subscribed MQTT-C client and potentially disclose adjacent heap memory by sending a single crafted PUBLISH packet.

Affected

Product or packageVersionsReported by
LiamBindle MQTT-Cbefore 1.1.7
Not affected: 1.1.7
CVE List

All scores

TuranSec7.8high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:H/SC:N/SI:N/SA:N/E:P/AU:Y/V:D
TuranSec8.2high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H

Classification

CWE-125CWE-191

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

LiamBindle MQTT-C versions prior to 1.1.7 contain a heap-based out-of-bounds read and integer underflow in the mqtt_unpack_publish_response() function in src/mqtt.c. A remote unauthenticated attacker controlling an MQTT broker, or capable of injecting MQTT traffic into an unencrypted session, can crash a subscribed MQTT-C client and potentially disclose adjacent heap memory by sending a single crafted PUBLISH packet.

NVD (es)

LiamBindle MQTT-C hasta la versión 1.1.6 contiene una lectura fuera de límites basada en el heap y un desbordamiento negativo de enteros en la función mqtt_unpack_publish_response() en src/mqtt.c que permite a un atacante remoto no autenticado que controla un broker MQTT - o capaz de inyectar tráfico MQTT en una sesión no cifrada - provocar la caída de un cliente MQTT-C suscrito y potencialmente divulgar memoria adyacente del heap enviando un único paquete PUBLISH manipulado. La función solo valida que el remaining_length del encabezado fijo sea al menos 4, luego lee el campo topic_name_size de 16 bits del paquete controlado por el broker y avanza el puntero de análisis por ese valor sin verificar que topic_name_size más la sobrecarga circundante encaje dentro de remaining_length; posteriormente calcula application_message_size como remaining_length - topic_name_size - 2 (QoS 0) o - 4 (QoS mayor que 0) en aritmética sin signo, produciendo un desbordamiento negativo de enteros que luego se pasa a memmove(). Un paquete PUBLISH con topic_name_size = 0xFFFF y remaining_length = 7 avanza el puntero de análisis 65535 bytes más allá del búfer de recepción (lectura fuera de límites) y provoca un application_message_size cercano a 2^32, provocando la caída del proceso cuando se ejecuta el memmove() resultante.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-54412 changed 2026-11-05CVE Terms of Use
NVDCVE-2026-54412 changed 2026-11-05Public domain