feat(legacy): warn before updating bootloader
What changed, and why it matters
This commit adds a user confirmation step before the Trezor device updates its bootloader. Previously, the bootloader update began automatically after detecting an older or known bootloader. The change shows a warning screen telling the user to make sure the cable is securely connected, then waits for the user to press the confirm button before erasing and rewriting the bootloader. This reduces the risk of bricking the device if power is lost during the update, but it is a safety/usability improvement rather than a fix for a software vulnerability that can be exploited remotely.
No urgent security action required. Treat as a normal firmware improvement. Users on affected devices should keep firmware updated through normal vendor channels. If auditing, verify that wait_for_confirm() correctly ignores pre-existing button presses and cannot be bypassed by an attacker with physical access.
Security signals we found
User confirmation added before destructive bootloader update
Warning about power-loss bricking risk during bootloader erase
Bootloader update is a high-privilege, device-modifying operation
Change is defensive: mitigates accidental bricking, not a remote exploit
Evidence from the diff
In legacy/firmware/bl_check.c, a new wait_for_confirm() helper is added under PRODUCTION || BOOTLOADER_QA builds. It polls the YES button via buttonRead() and buttonUpdate() until a fresh press-and-release is detected. check_and_replace_bootloader() now calls layoutDialog() with a warning about secure cable connection and then waits for user confirmation before proceeding to the existing bootloader erase/replace flow. The changelog fragment describes this as asking for confirmation before updating the bootloader.
Changed components
legacy/firmware/bl_check.cTrezor Model One (legacy) bootloader replacement flowInspect captured patch +27 / −0
### legacy/firmware/.changelog.d/8432.changed
@@ -0,0 +1 @@
+Ask for confirmation before updating the bootloader.
### legacy/firmware/bl_check.c
@@ -21,6 +21,7 @@
#include <stdint.h>
#include <string.h>
#include "bl_data.h"
+#include "buttons.h"
#include "gettext.h"
#include "layout.h"
#include "memory.h"
@@ -237,6 +238,23 @@ static int known_bootloader(int r, const uint8_t *hash) {
}
#endif
+#if PRODUCTION || BOOTLOADER_QA
+// Wait until the confirm button is pressed and released. A press that started
+// before the screen was shown does not count. The button GPIOs were set up by
+// the bootloader.
+static void wait_for_confirm(void) {
+ while ((buttonRead() & BTN_PIN_YES) == 0) {
+ delay(100000);
+ }
+ // Record the released state, so that the next release is a new press.
+ buttonUpdate();
+ do {
+ delay(100000);
+ buttonUpdate();
+ } while (!button.YesUp);
+}
+#endif
+
/**
* If bootloader is older and known, replace with newer bootloader.
* If bootloader is unknown, halt with error message.
@@ -268,6 +286,14 @@ void check_and_replace_bootloader(bool shutdown_on_replace) {
// ATTEMPTING TO OVERWRITE BOOTLOADER WITH UNSIGNED FIRMWARE MAY BRICK
// YOUR DEVICE.
+ // Let the user check the cable before the boot sectors are erased. A device
+ // that loses power while they are erased is bricked.
+ layoutDialog(&bmp_icon_warning, NULL, _("Update"), NULL,
+ _("Bootloader update"), _("required."),
+ _("Make sure your cable"), _("is securely connected"),
+ _("before continuing."), NULL);
+ wait_for_confirm();
+
layoutDialog(&bmp_icon_warning, NULL, NULL, NULL, _("Updating bootloader"),
NULL, NULL, _("DO NOT UNPLUG"), _("YOUR TREZOR!"), NULL);
Why this scored 24/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.