Hidden Commands Discovered in ESP32 Chips Used in Over a Billion Devices

BigGo Editorial Team
Hidden Commands Discovered in ESP32 Chips Used in Over a Billion Devices

Security researchers have uncovered a potential vulnerability that could affect billions of devices worldwide. The ESP32 microchip, a component found in countless IoT devices from smartphones to medical equipment, contains undocumented commands that could potentially be exploited under certain circumstances.

The Discovery

Spanish security researchers from Tarlogic Security have identified a set of 29 hidden vendor-specific commands in the ESP32 microchip's Bluetooth firmware. These proprietary Host Controller Interface (HCI) commands, including one identified as Opcode 0x3F, enable low-level control over Bluetooth functions and were not publicly documented by the manufacturer. The researchers presented their findings at RootedCON in Madrid, highlighting how these commands could potentially be leveraged to read and modify memory in the ESP32 controller.

The Scope of Impact

The ESP32 microchip, manufactured by Chinese company Espressif, is one of the world's most widely used components for enabling WiFi and Bluetooth connectivity in IoT devices. Its popularity stems partly from its affordability, with units costing as little as $2 on e-commerce platforms. According to Espressif, the chip is present in over a billion devices worldwide, including smartphones, smart locks, speakers, and even medical equipment, making the potential impact of any security issue significant.

ESP32 Microchip Details:

  • Manufacturer: Espressif (Chinese company)
  • Usage: Found in over 1 billion devices worldwide
  • Device types: Smartphones, computers, smart locks, medical equipment, speakers
  • Cost: As low as $2 on e-commerce platforms
  • Function: Provides WiFi and Bluetooth connectivity for IoT devices

Capabilities and Risks

The undocumented commands discovered by the researchers could allow operations such as reading and writing to RAM and Flash memory, spoofing MAC addresses to impersonate devices, and injecting LMP/LLCP packets. While these functionalities aren't inherently malicious and were likely included for debugging purposes, they could potentially be misused by attackers who have already gained access to a device. This could enable impersonation attacks, bypassing of security audits, or permanent modification of device behavior.

Hidden Commands Discovered:

  • 29 vendor-specific commands including Opcode 0x3F
  • Capabilities: Reading/writing to RAM and Flash memory, MAC address spoofing, LMP/LLCP packet injection
  • Affected models: Original ESP32 chips only (ESP32-C, ESP32-S, and ESP32-H series not affected)
  • Exploitation requirements: Typically requires physical access or already compromised firmware

Exploitation Limitations

It's important to note that these commands are not directly accessible remotely without additional vulnerabilities. Espressif has clarified that the commands cannot be triggered by Bluetooth, radio signals, or over the Internet, meaning they don't pose a risk of remote compromise on their own. The most practical attack scenario would likely involve physical access to the device's USB or UART interface, or already compromised firmware. Additionally, Espressif stated that if the ESP32 is used in a standalone application not connected to a host chip running a BLE host, the commands aren't exposed and pose no security threat.

Manufacturer Response

In response to the findings, Espressif has published an explainer addressing the concerns. The company emphasized that these are not a backdoor but rather debug interfaces provided by the IP. They clarified that having such private commands is not an uncommon practice in the industry. Despite maintaining that the commands don't pose a security risk by themselves, Espressif has committed to providing a software fix to remove these undocumented commands. The company also noted that only the original ESP32 chips are affected, not any of the ESP32-C, ESP32-S, and ESP32-H series.

Research Tools and Implications

To analyze and expose these hidden commands, Tarlogic developed a new C-based USB Bluetooth driver called BluetoothUSB. This tool provides hardware-independent and cross-platform access to Bluetooth traffic, enabling comprehensive security audits of Bluetooth devices without relying on OS-specific APIs. This addresses a significant gap in current security testing tools, which often require specialized hardware and are limited by their dependence on specific operating systems.

Future Security Considerations

The discovery highlights the importance of transparency in hardware components, especially those used in billions of devices worldwide. While the researchers initially used the term backdoor to describe their findings, they later clarified that these proprietary HCI commands could be more accurately considered hidden features. Nevertheless, the presence of undocumented functionality in widely used hardware components raises important questions about supply chain security and the potential for misuse in sensitive applications.