fix(python): set_log_filter and optiga_set_sec_max
What changed, and why it matters
This is a small bugfix in the Trezor Python command-line tool's debug-only commands. Two debug helpers were trying to reach the device's debug transport through an outdated path (session.client.protocol.transport) and were updated to the correct path (session.client.transport). These commands are only used in development/testing and do not affect normal wallet operations or end-user security.
No security action required. Treat as a normal maintenance fix. If reviewing, confirm that session.client.transport is the intended public interface and that debug commands remain gated behind debug builds/seedless sessions.
Security signals we found
Fixes broken debug-only CLI commands, not a runtime vulnerability
No privilege boundary crossed; commands already require seedless debug session
No input validation, memory safety, or cryptographic changes
No changelog entry suggests routine maintenance
Evidence from the diff
The patch corrects attribute traversal in two CLI debug commands: optiga_set_sec_max and set_log_filter. The previous code referenced session.client.protocol.transport.find_debug(), which no longer exists in the current client object layout; it now uses session.client.transport.find_debug(). This is a straightforward compatibility fix for internal debugging utilities that require a debug-enabled transport and session.
Changed components
python/src/trezorlib/cli/debug.pyoptiga_set_sec_max CLI commandset_log_filter CLI commandInspect captured patch +2 / −2
diff --git a/python/src/trezorlib/cli/debug.py b/python/src/trezorlib/cli/debug.py
index d9f93ea3..0d897a78 100644
--- a/python/src/trezorlib/cli/debug.py
+++ b/python/src/trezorlib/cli/debug.py
@@ -118,7 +118,7 @@ def prodtest_t1(session: "Session") -> None:
@with_session(seedless=True)
def optiga_set_sec_max(session: "Session") -> None:
"""Set Optiga's security event counter to maximum."""
- debug_transport = session.client.protocol.transport.find_debug()
+ debug_transport = session.client.transport.find_debug()
debug_transport.open()
debug = DebugLink(transport=debug_transport)
debuglink_optiga_set_sec_max(debug)
@@ -130,7 +130,7 @@ def optiga_set_sec_max(session: "Session") -> None:
@with_session(seedless=True)
def set_log_filter(session: "Session", filter: str) -> None:
"""Set logging filter string."""
- debug_transport = session.client.protocol.transport.find_debug()
+ debug_transport = session.client.transport.find_debug()
debug_transport.open()
debug = DebugLink(transport=debug_transport)
debuglink_set_log_filter(debug, filter)
Why this scored 18/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.