Regarding the “Undocumented Commands Discovered in ESP32” Reported by Various Media
2025.03.13
Regarding the “Undocumented Commands Discovered in ESP32” Reported by Various Media
(日本語文は英語文の次にあります)
Since the processor in question is also used in our products, we will provide an overview of the discovery and how it may affect our services.
About the Discovery
The official announcements from Espressif regarding this issue are as follows:
https://www.espressif.com/en/news/ResponseESP32Bluetooth
https://developer.espressif.com/blog/2025/03/esp32-bluetooth-clearing-the-air/
In summary:
• A vendor-specific debugging command exists within Bluetooth HCI, allowing memory access and other operations. However, this was not documented.
• These commands are only accessible via HCI commands and cannot be controlled via Bluetooth or Wi-Fi.
• Espressif plans to update the documentation and provide a software version that removes this functionality.
• This issue is exclusive to ESP32 and does not affect the ESP32-C series or other variants.
Thus, if an ESP32 device is in a state where HCI commands can be controlled, operations beyond Bluetooth manipulation—such as memory access—become possible.
Impact on obniz Products
The following obniz products do not use ESP32 and are therefore not affected by this issue:
• obniz BLE/Wi-Fi Gateway Gen2.0
• obniz BLE/LTE Gateway (Cat.4)
• LTE Evaluation Device
• Intelligent Edge Series
• Other custom devices for obniz Now customers
The following obniz products do incorporate ESP32:
• obniz Board Series (including 1Y and 1Y + Case)
• AK-030 LTE Cat.M1 USB Dongle for obniz Cloud
• obniz BLE/Wi-Fi Gateway
• obniz BLE/LTE Gateway
• obniz PLC
• M5Stack Basic (with obnizOS installed)
• M5StickC (with obnizOS installed)
• Other ESP32 devices flashed with obnizOS under a license agreement
Since obnizOS 3 and later support remote transmission of HCI commands, if you are using any of the above devices and your program sends HCI commands to an obniz device, you could utilize the debugging features mentioned in Espressif’s announcement.
Potential Risk
The risk arises if an external entity can send HCI commands to your device. The key risk factors include:
1. Using an obniz device that incorporates ESP32.
2. Running obnizOS 3 or later.
3. Allowing external entities to control the device using obniz.js or the WebSocket API.
If these conditions are met, unauthorized access to the memory and other operations via the discovered commands may become possible.
Immediate Risk Mitigation for Customers
The primary risk stems from unauthorized access to HCI commands. If an attacker gains control, they could perform any operations beyond this specific vulnerability.
To mitigate this risk, we recommend:
1. Registering your device with obnizCloud or obniz Now.
2. Enforcing access control using Access Tokens or API Keys.
In obniz Now, the use of Access Tokens is mandatory. For users of obniz Pipeline, Access Tokens are not strictly required but are enabled by default (e.g., when registering a device via QR code on the web interface).
Who Should Pay Special Attention?
The following users should be particularly cautious:
• DIY and educational users with only a few devices, who rarely use cloud features.
• Users running their own servers to control devices using obniz.js.
If your device is unregistered and used with only the obniz ID (without an Access Token), it could be vulnerable.
However, for educational use cases where devices are used only for a few hours annually and are always physically secured, the importance of a seamless experience may outweigh security concerns. In such cases, you may choose to continue using your device with only the obniz ID, provided you assess the associated risks.
Regardless, do not expose your obniz ID publicly on the internet, as it increases the risk of exploitation.
obniz’s Risk Mitigation Measures
For currently available devices, we will release a new version of obnizOS incorporating Espressif’s updated software once it becomes available.
As with previous OS updates, this update will be provided for free and will be available via OTA (Over-The-Air) updates.
• obnizCloud users: You can apply the OTA update via the Developer Console.
• obniz Now users: At this time, no affected devices are in use, so no OTA update is necessary.
いくつかのメディアで記載があったEspressif社の「ESP32に発見されたドキュメントに記載のないコマンド」について、弊社でも採用しているプロセッサであり、発表内容が弊社サービスへどのような影響を与えるかについて記載いたします。
発見された内容について
Espressif社が下記リリースより公式でアナウンスしている内容が正確です。
https://www.espressif.com/en/news/ResponseESP32Bluetooth
https://developer.espressif.com/blog/2025/03/esp32-bluetooth-clearing-the-air/
まとめますと下記となります。
- Bluetooth HCIにデバッグ用のベンダー固有コマンドがあり、メモリアクセスなどが可能。かつこれらがドキュメントに記載されていなかった
- それらはHCIコマンド経由でのみ利用可能でBluetoothやWi-Fiなどからは制御できない
- ドキュメントへの記載と機能を削除したソフトウェアを提供予定
- ESP32のみであり、ESP32-Cシリーズなどでは存在しない。
そのため、
- ESP32を利用中でHCIコマンドが制御できる状態となった際にBluetooth操作以外のメモリアクセスなどの操作も可能となる
というのが発見された内容となります。
obniz製品への影響
ESP32は以下の商品群には採用されていないため本発表とは関係がありません。
- obniz BLE/Wi-Fi Gateway Gen2.0
- obniz BLE/LTE Gateway (Cat.4)
- LTE評価装置
- Intelligent Edgeシリーズ
- そのほかobniz Nowのお客様向けのカスタムデバイス
ESP32を搭載しているのは弊社製品では下記のラインナップとなります。
- obniz Boardシリーズ(1Yや1Y + Case)
- AK-030 LTE Cat.M1 USB Dongle for obniz Cloud
- obniz BLE/Wi-Fi Gateway
- obniz BLE/LTE Gateway
- obniz PLC
- M5Stack Basic(obnizOS書き込み品)
- M5StickC(obnizOS書き込み品)
- そのほかライセンスを元にESP32へobnizOSを書き込んだもの
obnizOS3以降は遠隔でHCIコマンドの送信が可能です。そのため上記デバイスをご利用中でかつ自身のプログラムでHCIコマンドをobnizの端末に対して送信した場合は発表にあるデバッグ機能を利用できる状態となります。
つまりお持ちのデバイスに対してHCIコマンドを他社が送信できるようになった場合がリスクとなります。リスクとしては
- ESP32が採用された弊社デバイスをご利用中
- obnizOS3以上を利用中
- obniz.jsまたはWebsocketAPIで他人が対象となる機器を制御可能でのっとれる状態にある時
において、発見されたコマンドを利用してメモリの読み書きなどが可能な状態となります。
お客様で行える今すぐに可能なリスク対策について
HCIコマンドを他人が送れる状態にあることが最大のリスクとなります。その場合には本コマンドに限らずあらゆる操作が可能な状態です。
つまりobnizIDのみで利用できる状態にあることがリスクとなります。以下の対策を行っていただくことで他人がHCIコマンドをお持ちの機器に対して送信することを防ぐことができます。
- 購入機器はobnizCloudまたはobniz Nowへ登録する。
- 機器にはアクセストークンを発行し、アクセストークンまたはAPI Keyを利用して機器と接続する。
obniz Nowではアクセストークンの利用が必須となっております。obniz Pipelineをお使いのお客様はアクセストークンは必須ではないものの上記が利用のためのデフォルト動作となっております(Web画面上のQRコードによる登録機能をお使いの場合)。
そのため、主に以下のような使い方のお客様に注意が必要です。
- DIYや教育向けに数台などでご利用中。クラウド機能はあまり使っていない。
- 自身・自社で立ち上げたサーバーでobniz.jsを利用したプログラムから制御している
上記のケースにおいては未登録またはアクセストークンの発行がなくかつobnizIDだけでご利用されているケースが考えられます。
ただし、例えば教育現場などではそもそも年間を通して十数時間の利用しかなく必ず機器は手元にあり、かつIDのみで利用できることが体験上重要であるというケースではリスクを判断されたうえで引き続きIDのみでの操作を継続される判断もあり得ると考えております。
その場合においては、本件に限りませんが、obnizIDについてはインターネット上に公開するなどの行為はリスクを増大させるためお控え下さい。
obniz社のリスク対策について
現在サポート中のデバイスについて、今後Espressif社がコマンドを削除したバージョンのソフトウェアを発表を確認した後、それを取り込んだ新しいバージョンのOSをリリースします。通常のOSリリース時と同じくこちらも無料でOTAが可能ですので、obnizCloud利用者様は開発者コンソールよりOTAをご利用下さい。obniz Now利用者様は現時点では対象となる機器がありませんのでOTAの必要はありません。