chore: cannot have both info and external_menu
What changed, and why it matters
This commit is a small defensive cleanup in Trezor's user-interface code. It adds a runtime check that prevents two UI features—'info' and 'external_menu'—from being used at the same time, because that combination is not implemented. It also removes two places in Python code that accidentally passed both flags together. The change makes a previously silent debug-only assertion into an explicit error, which helps avoid unexpected UI behavior rather than fixing an active security vulnerability.
Treat as a routine defensive fix. Review whether any other UI layouts or callers combine `info` and `external_menu`, and ensure the runtime error is handled gracefully by callers. No urgent security response is indicated by the commit itself.
Security signals we found
Defensive invariant enforcement (info and external_menu are mutually exclusive)
Replacement of debug-only assertion with runtime error
Removal of conflicting parameter usage in Python callers
No changelog entry, consistent with internal chore/cleanup
Evidence from the diff
The patch enforces mutual exclusivity of the info and external_menu parameters in the Delizia and Eckhart firmware UI layouts. In layout_delizia/ui_firmware.rs, a new if info && external_menu { return Err(Error::NotImplementedError); } guard is added. In layout_eckhart/ui_firmware.rs, an existing debug_assert!(!(info && external_menu)) is replaced by the same runtime error return. In core/src/trezor/ui/layouts/delizia/__init__.py, the confirm_value helper stops setting info=True when info_items are present, and confirm_signverify stops passing both info=True and external_menu=True. The commit message frames this as a missing assertion and a conversion of an unused debug_assert! into a NotImplementedError.
Changed components
core/embed/rust/src/ui/layout_delizia/ui_firmware.rscore/embed/rust/src/ui/layout_eckhart/ui_firmware.rscore/src/trezor/ui/layouts/delizia/__init__.pyInspect captured patch +7 / −3
diff --git a/core/embed/rust/src/ui/layout_delizia/ui_firmware.rs b/core/embed/rust/src/ui/layout_delizia/ui_firmware.rs
index ae7f4dd6..93883306 100644
--- a/core/embed/rust/src/ui/layout_delizia/ui_firmware.rs
+++ b/core/embed/rust/src/ui/layout_delizia/ui_firmware.rs
@@ -126,6 +126,10 @@ impl FirmwareUI for UIDelizia {
_warning_footer: Option<TString<'static>>,
external_menu: bool,
) -> Result<Gc<LayoutObj>, Error> {
+ if info && external_menu {
+ return Err(Error::NotImplementedError);
+ }
+
ConfirmValue::new(title, value.try_into()?, description)
.with_description_font(&theme::TEXT_SUB_GREY)
.with_text_mono(is_data)
diff --git a/core/embed/rust/src/ui/layout_eckhart/ui_firmware.rs b/core/embed/rust/src/ui/layout_eckhart/ui_firmware.rs
index 39ee685c..522036fd 100644
--- a/core/embed/rust/src/ui/layout_eckhart/ui_firmware.rs
+++ b/core/embed/rust/src/ui/layout_eckhart/ui_firmware.rs
@@ -456,7 +456,9 @@ impl FirmwareUI for UIEckhart {
warning_footer: Option<TString<'static>>,
external_menu: bool,
) -> Result<Gc<LayoutObj>, Error> {
- debug_assert!(!(info && external_menu));
+ if info && external_menu {
+ return Err(Error::NotImplementedError);
+ }
let paragraphs = ConfirmValueParams {
description: description.unwrap_or("".into()),
diff --git a/core/src/trezor/ui/layouts/delizia/__init__.py b/core/src/trezor/ui/layouts/delizia/__init__.py
index aebbdf8a..962a63d4 100644
--- a/core/src/trezor/ui/layouts/delizia/__init__.py
+++ b/core/src/trezor/ui/layouts/delizia/__init__.py
@@ -814,7 +814,6 @@ def confirm_value(
description=description,
subtitle=subtitle,
verb=verb,
- info=bool(info_items),
hold=hold,
chunkify=chunkify,
cancel=cancel,
@@ -1542,7 +1541,6 @@ async def confirm_signverify(
value=address,
description="",
verb=TR.buttons__continue,
- info=True,
chunkify=chunkify,
external_menu=True,
)
Why this scored 30/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.