Skip to main content
Vulnerability Database/CVE-2024-53845

CVE-2024-53845: ESPTouch IoT Protocol Information Disclosure

CVE-2024-53845 is an information disclosure flaw in ESPTouch protocol affecting IoT devices due to improper AES initialization vector handling. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2024-53845 Overview

CVE-2024-53845 is a cryptographic weakness [CWE-327] in the ESPTouch v2 provisioning protocol used by Espressif IoT devices. The protocol allows a custom AES key but hardcodes the Initialization Vector (IV) to zero in AES/CBC mode. A static IV makes ciphertext deterministic across sessions, enabling an attacker observing provisioning traffic to correlate and leak sensitive provisioning data such as Wi-Fi credentials. The flaw affects ESP-IDF versions prior to 5.3.2, 5.2.4, 5.1.6, and 5.0.8. Because the issue resides in the Espressif Wi-Fi stack, application-layer fixes are not possible without a firmware upgrade.

Critical Impact

Deterministic AES/CBC output caused by a zero IV can expose confidential provisioning data, including Wi-Fi credentials transmitted during ESPTouch v2 setup.

Affected Products

  • ESP-IDF ESPTouch v2 component before 5.3.2
  • ESP-IDF ESPTouch v2 component before 5.2.4
  • ESP-IDF ESPTouch v2 component before 5.1.6 and 5.0.8

Discovery Timeline

  • 2024-12-12 - CVE CVE-2024-53845 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2024-53845

Vulnerability Analysis

ESPTouch v2 is a SmartConfig-style provisioning protocol that broadcasts network credentials from a mobile application to an un-provisioned Wi-Fi device. The protocol supports AES encryption with a user-supplied key but, prior to the fixed releases, exposed no API to configure the AES IV. The IV remained set to zero for the lifetime of the product, violating the core requirement of CBC mode that each encryption operation uses a unique, unpredictable IV.

With a constant IV and a reused AES key, identical plaintext blocks produce identical ciphertext blocks across provisioning sessions. An attacker within Wi-Fi broadcast range of the provisioning traffic can collect ciphertext samples and perform frequency analysis, known-plaintext correlation, or chosen-plaintext attacks against the deterministic output. The classification under [CWE-327] (Use of a Broken or Risky Cryptographic Algorithm) reflects the misuse of CBC rather than a flaw in AES itself.

Root Cause

The root cause is the absence of a random IV generation path in the ESPTouch v2 implementation. The application side defaulted the IV to all-zero bytes, and the provisioning device parser had no mechanism to receive or interpret an alternative IV value. This design decision made every ciphertext output a function solely of the key and plaintext.

Attack Vector

Exploitation requires network-adjacent passive observation of ESPTouch v2 provisioning packets. Because the attack is passive and requires no privileges or user interaction, any attacker within radio range during provisioning can collect encrypted broadcast frames. Repeated provisioning events or long-lived keys amplify the correlation attack surface and increase the likelihood of recovering sensitive fields.

text
// Patch excerpt: docs/en/api-reference/network/esp_smartconfig.rst
// Source: https://github.com/espressif/esp-idf/commit/4f85a2726e04b737c8646d865b44ddd837b703db

Starting from SmartConfig v3.0.2, ESPTouch v2 introduces support for
random IV in AES encryption. On the application side, when the option
for random IV is disabled, the default IV is set to 0, maintaining
consistency with previous versions. When the random IV option is
enabled, the IV will be a random value. [...] On the provisioning
device side, the device will identify whether the random IV for AES is
enabled based on the flag in the provisioning packet.

Detection Methods for CVE-2024-53845

Indicators of Compromise

  • Repeated ESPTouch v2 provisioning broadcasts producing identical ciphertext blocks for identical plaintext inputs.
  • ESP-IDF firmware builds reporting esp_smartconfig_get_version() values below SmartConfig v3.0.2.
  • Devices running ESP-IDF releases older than 5.3.2, 5.2.4, 5.1.6, or 5.0.8.

Detection Strategies

  • Inventory all Espressif-based IoT devices and extract the embedded ESP-IDF version from firmware images or OTA manifests.
  • Perform passive Wi-Fi captures during provisioning in a controlled environment to confirm whether an IV flag is present in the packet payload.
  • Flag any build pipeline producing firmware against vulnerable ESP-IDF branches so remediation can be prioritized.

Monitoring Recommendations

  • Monitor supplier bulletins and the GitHub Security Advisory GHSA-wm57-466g-mhrr for updates affecting dependent products.
  • Track provisioning events on managed networks and alert when ESPTouch v2 broadcasts originate from devices on legacy firmware.
  • Record the ESP-IDF version and SmartConfig version as part of asset metadata for every onboarded IoT device.

How to Mitigate CVE-2024-53845

Immediate Actions Required

  • Upgrade affected devices to ESP-IDF 5.3.2, 5.2.4, 5.1.6, or 5.0.8 or later, which introduce random IV support in ESPTouch v2.
  • Rebuild and reflash both the embedded firmware and the companion mobile provisioning application against the patched ESP-IDF release.
  • Rotate any AES keys that were previously used with the static zero IV to invalidate collected ciphertext.

Patch Information

Espressif addressed the issue in SmartConfig v3.0.2, delivered as part of ESP-IDF versions 5.3.2, 5.2.4, 5.1.6, and 5.0.8. The fix generates a random IV when AES is activated, transmits the IV alongside provisioning data, and adds a parser on the provisioning device so it can interpret the per-session IV. Relevant commits include ESP-IDF commit 4f85a27, commit 8fb28dc, commit d47ed7d, commit de69895, and commit fd224e83.

Workarounds

  • No application-layer workaround exists; the fix must be applied to the underlying ESP-IDF firmware per the vendor advisory.
  • Perform provisioning on an isolated or RF-shielded network segment to limit passive eavesdropping on legacy devices awaiting firmware upgrade.
  • Prefer alternative provisioning methods described in the ESP-IDF provisioning documentation until vulnerable devices are updated.
bash
# Verify the installed ESP-IDF version and update to a patched release
idf.py --version
cd $IDF_PATH
git fetch --tags
git checkout v5.3.2   # or v5.2.4 / v5.1.6 / v5.0.8
./install.sh
. ./export.sh
idf.py fullclean && idf.py build flash

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.