Skip to main content

xiaozhi-esp32 CVE-2026-13491

| EUVDEUVD-2026-39991 LOW
Improper Resource Shutdown or Release (CWE-404)
2026-06-28 VulDB GHSA-rwf9-x45x-533w
2.9
CVSS 4.0 · Vendor: VulDB
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Gain access to MQTT broker or channel
  2. Delivery
    Craft goodbye message with non-string session_id field
  3. Exploit
    Publish malformed message to device topic
  4. Execution
    Bypass NULL check via cJSON type confusion
  5. Persist
    Dereference invalid valuestring pointer
  6. Impact
    MQTT session handler crashes

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Resource release
Exploitation Conditions

The device must be connected to an MQTT broker that the attacker can publish to, or the attacker must be positioned to inject MQTT messages into the device's communication channel. The MQTT goodbye message must include a session_id JSON field set to a non-string type (e.g., integer, boolean, null-typed cJSON node) to bypass the old NULL check. The CVSS 4.0 vector specifies PR:N, meaning no authentication to the target device itself is required, but practical exploitation depends on MQTT broker access controls - if the broker enforces client authentication, the attacker must first obtain valid broker credentials or perform a man-in-the-middle attack. High attack complexity (AC:H) reflects the need to understand the specific MQTT message format and cJSON type system. The vulnerability does not affect confidentiality or integrity - only availability (session crash). Default configurations where the MQTT broker is accessible from untrusted networks represent the highest-risk deployment.

Impact

The CVSS 4.0 vector (AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:P) yields a base score of 6.3, reflecting a network-reachable flaw requiring no privileges but significant attack complexity. Availability impact is rated Low (VA:L), consistent with a session-level crash rather than full firmware bricking, though on an embedded IoT device any crash effectively takes the device offline until a restart. EPSS data is not provided; given the niche deployment footprint of ESP32 AI firmware, opportunistic mass exploitation is unlikely. A public proof-of-concept exists on GitHub (issue #2022), which elevates the risk for targeted attacks against known deployments. The high complexity rating (AC:H) is the primary mitigating signal - the attacker must craft a valid but malformed MQTT goodbye message with a non-string session_id field, which requires understanding the protocol internals. No CISA KEV listing confirms this has not been observed in widespread active exploitation. This is a real but bounded risk: relevant primarily for IoT deployments where the xiaozhi-esp32 device is exposed to untrusted MQTT broker traffic or where the MQTT broker itself can be reached by adversaries.

Exploit ScenarioDerived

An attacker with access to the MQTT broker (or acting as a man-in-the-middle on the MQTT channel) publishes a crafted goodbye message to the device's subscribed topic where the session_id field is a JSON number or boolean rather than a string. The ESP32 firmware's cJSON parser returns a non-null node that fails the old NULL check, causing the firmware to dereference an invalid valuestring pointer and crash the MQTT session handler. A public proof-of-concept describing this technique exists at https://github.com/78/xiaozhi-esp32/issues/2022.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 28, 2026

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.

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.

Affected VersionsENISA

xiaozhi-esp32 2.2.1
xiaozhi-esp32 2.2.3
xiaozhi-esp32 2.2.5
xiaozhi-esp32 2.2.6
xiaozhi-esp32 2.2.2
xiaozhi-esp32 2.2.4
xiaozhi-esp32 2.2.0

Affected Packages

euvd xiaozhi_esp32 no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

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.

Know when Xiaozhi Esp32 gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulDB) PRIMARY 2.9 MEDIUM
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
vuln.today AI 3.7 LOW

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.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N

Primary rating from Vendor (VulDB).

CVSS VectorVendor: VulDB

Attack Vector
Network
Attack Complexity
High
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Severity Changed
Jun 28, 2026 - 12:22 NVD
MEDIUM LOW
CVSS changed
Jun 28, 2026 - 12:22 NVD
6.3 (MEDIUM) 2.9 (LOW)

DescriptionCVE.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.

Threat Intelligence Overview

EPSS Score
0.4%
Top 67% exploitable
Prevalence
Rare
niche open-source ESP32 AI chatbot firmware project
Exploit
POC
Public exploit code exists
Social Media
2
Sightings
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity LOW
CISA KEV No
Public POC Yes
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Low
Technical Impact
Partial

Priority Score

34
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +14
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy