Executive brief
A vulnerability exists in the xiaozhi-esp32 firmware, which is used for ESP32-based AI chatbots. An attacker can remotely send a specially crafted message to the device to prematurely terminate active audio sessions. This results in a denial of service for the user's current interaction with the chatbot.
Technical details
A denial of service vulnerability exists in the MQTT Goodbye Handler of xiaozhi-esp32 firmware up to version 2.2.6. The root cause is located in the `Application::GetInstance` function within `main/protocols/mqtt_protocol.cc`, where the handler fails to properly validate the `session_id` in incoming MQTT 'goodbye' messages. Specifically, the code previously allowed a session to be closed if the `session_id` was null or matched the current ID without verifying the message source or topic binding. A remote attacker can exploit this by publishing a JSON payload `{"type":"goodbye"}` to the device's MQTT callback, causing the device to call `CloseAudioChannel` and reset the UDP connection. A patch has been released in commit e182471f8c5a22434346bd98da34d3b66c8c8b3e which enforces string validation and strict session ID matching.
Affected products
- 78 xiaozhi-esp32 up to 2.2.6
Timeline
- 2026-05-27: disclosed: Issue reported on GitHub repository
- 2026-05-28: patched: Fix merged into main branch
- 2026-06-28: advisory: CVE published to NVD
References
- https://github.com/78/xiaozhi-esp32/
- https://github.com/78/xiaozhi-esp32/commit/e182471f8c5a22434346bd98da34d3b66c8c8b3e
- https://github.com/78/xiaozhi-esp32/issues/2022
- https://github.com/78/xiaozhi-esp32/pull/2023
- https://vuldb.com/cve/CVE-2026-13491
- https://vuldb.com/submit/838439
- https://vuldb.com/vuln/374488