fix(build): no ui_debug_overlay only in prod
What changed, and why it matters
This commit adjusts when a firmware feature called 'ui_debug_overlay' is enabled during the build process. Previously, it was enabled for all optimized builds (PYOPT), which likely includes production releases. Now it is only enabled alongside other debug features when debug mode (PYOPT='0') is active. The change prevents a debug UI overlay from being compiled into production firmware.
Verify that production firmware images no longer contain the ui_debug_overlay feature. Review whether any released production builds shipped with this debug overlay enabled and assess whether the overlay exposes sensitive runtime information. No immediate user action is required.
Security signals we found
Debug feature enabled in production builds before patch
Build-time feature flag misconfiguration corrected
UI debug overlay removed from optimized firmware builds
Evidence from the diff
The patch removes the unconditional inclusion of ‘ui_debug_overlay’ whenever PYOPT is truthy (i.e., optimized/production builds). Instead, ‘ui_debug_overlay’ is now appended only in the PYOPT == ‘0’ branch alongside ‘debug’ and ‘ui_debug’. This ensures the overlay feature is gated behind debug builds rather than production builds.
Changed components
core/SConscript.firmwareTrezor firmware build configurationui_debug_overlay featureInspect captured patch +1 / −2
diff --git a/core/SConscript.firmware b/core/SConscript.firmware
index 8193f451..31bdc251 100644
--- a/core/SConscript.firmware
+++ b/core/SConscript.firmware
@@ -862,12 +862,11 @@ features = ['micropython', 'protobuf', 'ui', 'translations'] + FEATURES_AVAILABL
if PYOPT == '0':
features.append('debug')
features.append('ui_debug')
+ features.append('ui_debug_overlay')
if EVERYTHING:
features.append('universal_fw')
if UI_PERFORMANCE_OVERLAY:
features.append('ui_performance_overlay')
-if PYOPT:
- features.append('ui_debug_overlay')
rust = tools.add_rust_lib(
Why this scored 26/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.