fix(core): use bridge if other transports are unavailable
What changed, and why it matters
This commit changes the order in which Trezor's Python library tries different ways to connect to a hardware wallet, and switches from an unordered collection to an ordered list. The practical effect is that if newer direct connection methods (USB, Bluetooth, etc.) are unavailable, the library will fall back to the older 'bridge' method. This is a reliability/usability fix, not a clear security patch. There is no vendor statement that this fixes a security vulnerability.
Treat as a routine reliability fix. Review whether the bridge transport has any weaker security assumptions than direct transports, and ensure fallback behavior is documented. No urgent security action is indicated by the diff alone.
Security signals we found
Behavior change in transport enumeration priority
Bridge transport moved from first to last/fallback position
Collection type changed from unordered set to ordered list to make priority deterministic
Evidence from the diff
In python/src/trezorlib/transport/init.py, the all_transports() function previously returned a set of enabled transports with BridgeTransport listed first. Because Python sets do not preserve insertion order, the actual priority was unpredictable. The patch moves BridgeTransport to the end of the tuple and returns a list instead of a set, ensuring deterministic ordering and making BridgeTransport a fallback after HidTransport, UdpTransport, WebUsbTransport, and BleTransport. This improves connection reliability when newer transports are unavailable, but does not by itself fix an obvious security flaw.
Changed components
python/src/trezorlib/transport/__init__.pytrezorlib transport enumeration logicBridgeTransport fallback behaviorInspect captured patch +2 / −2
diff --git a/python/src/trezorlib/transport/__init__.py b/python/src/trezorlib/transport/__init__.py
index 48a0cf10..d9415ead 100644
--- a/python/src/trezorlib/transport/__init__.py
+++ b/python/src/trezorlib/transport/__init__.py
@@ -168,13 +168,13 @@ def all_transports() -> t.Iterable[type[Transport]]:
from .webusb import WebUsbTransport
transports: tuple[type[Transport], ...] = (
- BridgeTransport,
HidTransport,
UdpTransport,
WebUsbTransport,
BleTransport,
+ BridgeTransport,
)
- return set(t for t in transports if t.ENABLED)
+ return [t for t in transports if t.ENABLED]
def enumerate_devices(
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.