Have a project in mind? Let's talk.

ESP32 OTA update security is the discipline of making sure that the one feature that can replace all of your firmware in the field cannot be turned against you. An over-the-air update path is the most powerful capability on a shipped device: it reaches every unit, runs with full privileges, and touches the exact memory the device boots from. Espressif's own security guidance treats the update path as part of the chain of trust, not a feature bolted on afterwards. Source
This checklist is built from Espressif's primary documentation: the ESP-IDF Security Overview, the OTA API reference, and the Secure Boot v2 guide. Anything that is our operational advice rather than documented behavior is marked as such.
Secure Boot ensures that only authenticated software can execute on the device, and it verifies signatures both at boot-up and during OTA updates. On ESP32 from chip revision v3.0 onwards, Secure Boot v2 uses RSA-PSS verification: the ROM bootloader verifies the second stage bootloader's signature block, and the bootloader verifies the application image's signature block before running it. Source Source
The key detail for OTA: each image carries a signature block appended to it, containing an RSA-3072 signature and the corresponding public key, while a digest of that public key lives in the chip's eFuse. Only one public key can be provisioned during manufacturing on ESP32 v3.0, and the private key never touches the device. If verification of a new OTA image fails, the bootloader falls back to verifying other application images until it finds a valid one or none remain. Source
Espressif's recommendation is unambiguous: Secure Boot should be enabled on all production devices. When Secure Boot is enabled, your update server hosts the signed application image, and unsigned or wrongly signed images simply never run. Source
Espressif states plainly that OTA updates must happen over a secure transport such as HTTPS, and provides the ESP HTTPS OTA abstraction for exactly this. TLS protects the image in transit and authenticates the server, but note what it does not do: TLS says nothing about whether the image itself is legitimate. That is what signature verification covers, which is why the two controls stack rather than substitute for each other. Source Source
Certificate handling needs a plan for the whole product lifetime. The Security Overview lists why a root certificate list may need updating: new firmware uses different remote endpoints, an existing certificate expires, a certificate is added or retracted from the upstream bundle, or the bundled certificate list changes. Their guidance is to enable OTA rollback and use a successful connection to the OTA server as the checkpoint that cancels rollback, so new firmware that cannot reach the server automatically falls back to the previous firmware. Source
One subtlety worth copying verbatim into your design doc: if you enable time and date validation in mbedTLS, you also need a time sync mechanism such as SNTP and enough trusted certificates in place, or certificate checks will fail for the wrong reasons. Source
Flash encryption encrypts the contents of the off-chip flash memory, protecting the confidentiality of software and data stored there. For OTA specifically, Espressif notes that when flash encryption is enabled, no extra steps are required on the server side: encryption is handled on the device itself during the flash write. Source
Two best practices from the same guide belong in every production plan: use Release Mode for production devices, and use a unique flash encryption key per device. If you want the firmware to stay encrypted in transit as well, ESP-IDF supports OTA upgrades with pre-encrypted firmware, which Espressif describes as an additional layer on top of TLS that also protects the identity of the application. Source
These two features sound similar and do opposite jobs. App rollback keeps the device working: after an OTA update, the new app boots in a pending state and must prove itself. If diagnostics pass, the app calls esp_ota_mark_app_valid_cancel_rollback() and becomes permanent. If they fail, it calls esp_ota_mark_app_invalid_rollback_and_reboot() and the bootloader returns to the previous working app. If rollback is enabled and a reset happens before either call, the bootloader rolls back automatically. Source
Anti-rollback protection defends against a different threat: a correctly signed but deliberately old image. An attacker, or even your own release process, could push a previous version that contains a revoked credential or a known vulnerability and it would pass signature checks. Anti-rollback stores a security version in the device eFuse and compares it against the application image header during both boot-up and OTA updates, rejecting anything below the current security version. Source
Our advice, separate from the docs: treat the security version as a one-way ratchet and only bump it when you actually need to revoke something. Every bump is permanent for the whole fleet, so a casual increment can strand devices that miss an update window.
The cryptography in Secure Boot v2 is only as strong as the handling of the private signing key. Espressif's best practices: generate the signing key on a system with a quality source of entropy, always keep the key private since a leak compromises the entire Secure Boot system, and do not let any third party observe the key generation or signing process, because those operations are vulnerable to timing and other side-channel attacks. Source
The same section adds a hardware-level requirement that teams routinely miss: make sure all security eFuses are correctly programmed, including disabling debug interfaces and non-required boot mediums such as the UART download mode. An open debug interface bypasses the entire chain of trust you just built. Source
On the operational side, the OTA reference includes a recovery tool worth knowing: esp_ota_resume() continues an interrupted update from the last written offset instead of starting over, which matters on flaky cellular or Wi-Fi links where a retry-from-zero policy can effectively brick devices behind bad connections. Source
Here is the full set, condensed:
Enable Secure Boot v2 on every production device (chip revision v3.0 or later on ESP32).
Serve OTA images only over HTTPS with a maintained certificate bundle and a rotation plan.
Enable flash encryption in Release Mode, with a unique key per device.
Enable app rollback, and use a successful server connection or real diagnostics as the validity checkpoint.
Enable anti-rollback protection and manage the eFuse security version as a deliberate, one-way ratchet.
Generate signing keys offline with quality entropy, restrict who and what can run the signing commands, and never place the private key on a device or server that ships images.
Disable debug interfaces and unused boot paths via eFuse before the fleet ships.
Test the entire workflow virtually first: ESP32 security features can be exercised under the QEMU emulator before touching real hardware. Source
OTA security does not stand alone. The same fleet needs encrypted transport for its telemetry, which we covered in our ESP32 MQTT TLS guide, and locked-down local radios, covered in our ESP32 BLE security post. If the device runs an on-device agent or talks to one, our ESP32 agent device security post covers that layer.
That last connection matters more every quarter: as devices gain agent-like autonomy, the update path stops being just firmware maintenance and becomes the channel that changes device behavior wholesale. Getting these six controls right is the difference between a fleet you own and a fleet someone else can.
ESP32 OTA update security is six controls working as one system: Secure Boot v2 to authenticate images, HTTPS to protect transit, flash encryption for data at rest, app rollback for safety, anti-rollback for revocation, and disciplined key management to hold it all together. Every one of them is documented, supported in ESP-IDF, and testable under QEMU before you burn a single eFuse. The checklist above is the order we would enable them.
No. HTTPS authenticates the server and encrypts transit, but it cannot tell a legitimate image from a tampered one. Secure Boot v2 signature verification covers image authenticity, so Espressif's guidance stacks both: signed images over HTTPS. Security Overview
App rollback recovers the device when a new update is broken: the bootloader returns to the previous working app if the new one never marks itself valid. Anti-rollback blocks correctly signed but older images below the eFuse security version, so revoked firmware cannot be reinstalled. OTA reference Security Overview
No. Espressif states that with flash encryption enabled, no additional server-side steps are required because encryption happens on the device during the flash write. If you want the image encrypted in transit too, ESP-IDF supports pre-encrypted firmware distribution as an extra layer on top of TLS. Security Overview
Secure Boot v2 with the RSA-PSS scheme is available on ESP32 from chip revision v3.0 onwards. Earlier revisions use the original Secure Boot scheme, which Espressif documents separately. Secure Boot v2
Yes. Espressif notes that ESP32 security features can be tried under the QEMU emulator, so you can establish the full secure workflow virtually and only then move to physical devices and eFuse programming. Security Overview
Ready to take the first step towards unlocking opportunities, realizing goals, and embracing innovation? We're here and eager to connect.