Severity by source
CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:P/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Network-reachable via MQTT but AC:H due to required message crafting knowledge; PR:N per CVSS 4.0 input; availability only, low impact as session crash may auto-recover.
Primary rating from Vendor (VulDB).
CVSS VectorVendor: VulDB
Lifecycle Timeline
4DescriptionCVE.org
A vulnerability was detected in 78 xiaozhi-esp32 up to 2.2.6. This vulnerability affects the function Application::GetInstance of the file main/protocols/mqtt_protocol.cc of the component MQTT Goodbye Handler. Performing a manipulation of the argument session_id results in denial of service. The attack is possible to be carried out remotely. The complexity of an attack is rather high. It is stated that the exploitability is difficult. The exploit is now public and may be used. The patch is named e182471f8c5a22434346bd98da34d3b66c8c8b3e. It is recommended to apply a patch to fix this issue.
AnalysisAI
Denial-of-service in xiaozhi-esp32 MQTT firmware (versions up to 2.2.6) allows a remote attacker to crash the device's MQTT session handler by sending a crafted goodbye message containing a non-string session_id field. The MQTT Goodbye Handler in mqtt_protocol.cc fails to validate the cJSON type of the session_id node before dereferencing its valuestring member, producing undefined behavior that terminates the session. A public proof-of-concept exists (GitHub issue #2022), but attack complexity is rated high (AC:H) and the vulnerability is not listed in the CISA KEV catalog, suggesting exploitation requires deliberate effort rather than opportunistic scanning.
Technical ContextAI
xiaozhi-esp32 (CPE: cpe:2.3:a:78:xiaozhi-esp32:*:*:*:*:*:*:*:*) is an open-source AI assistant firmware targeting Espressif ESP32 microcontrollers. Communication is handled over MQTT, and the affected code path processes 'goodbye' control messages that signal session termination. The vulnerable code in MqttProtocol::StartMqttClient (mqtt_protocol.cc, line ~114) used a raw NULL check - session_id == nullptr - before accessing session_id->valuestring. Because cJSON nodes can be non-null while representing non-string types (numbers, booleans, arrays, objects), a crafted goodbye message with a non-string session_id bypasses the NULL guard and dereferences an invalid or null valuestring pointer. The root cause class is CWE-404 (Improper Resource Shutdown or Release), reflecting that the session teardown path fails to properly validate inputs before releasing session state, though the mechanism is more precisely a cJSON type-confusion leading to an unsafe dereference during shutdown.
RemediationAI
Apply the upstream patch commit e182471f8c5a22434346bd98da34d3b66c8c8b3e, available via GitHub pull request #2023 (https://github.com/78/xiaozhi-esp32/pull/2023). The fix replaces the unsafe NULL check with cJSON_IsString(session_id) and changes the session_id match condition from a logical OR (allowing a null session_id to trigger goodbye for any session) to a logical AND (requiring a valid string match), correcting both the type-safety issue and a logic flaw in session matching. A released tagged version incorporating this fix is not independently confirmed from the available data - operators should build from the patched commit directly. As a compensating control if patching is not immediately feasible, restrict MQTT broker access to trusted clients only using broker-level ACLs or network segmentation, which limits the attack surface to authenticated or internal actors. Note that broker-level controls do not eliminate the vulnerability but reduce the pool of potential attackers.
More in Xiaozhi Esp32
View allSame weakness CWE-404 – Improper Resource Shutdown or Release
View allSame technique Denial Of Service
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-39991
GHSA-rwf9-x45x-533w