fix(python/trezorlib): enable entropy check on T1 by default
What changed, and why it matters
This commit changes the Trezor Python library so that, when setting up a Trezor Model One (the original Trezor 1 device), it now performs an entropy check by default if the device runs firmware 1.13.1 or newer. Previously, the library only enabled this check on newer Trezor models and treated all Model One devices as not supporting it. An entropy check helps verify the device is generating randomness properly during wallet setup. The change is a defensive fix to enable a security feature on a previously excluded device line, not a patch for an active vulnerability.
Users of trezorlib who set up Trezor Model One devices should upgrade to the version containing this commit and ensure Model One firmware is at least 1.13.1 if they want the entropy check to run by default. No urgent mitigation is required; this is a hardening improvement.
Security signals we found
Enables a previously disabled security/validation feature (entropy check) for a specific device model
Adds version-gated behavior to avoid errors on older firmware
Defensive hardening of wallet setup randomness verification
No evidence of memory corruption, injection, or authentication bypass in the diff
Evidence from the diff
In python/src/trezorlib/device.py, the setup() function now distinguishes between Model One and other models when deciding whether to request an entropy check. A new constant ENTROPY_CHECK_MIN_VERSION_T1 = (1, 13, 1) is introduced. When entropy_check_count is None, the code checks session.features.model == “1” and uses the Model One minimum version; otherwise it uses the existing core-family minimum (2, 8, 7). If the firmware is older than the applicable minimum, entropy_check_count is set to 0 (no check); otherwise a random value between 2 and 8 is chosen. The docstring is updated accordingly. The changelog fragment states the same change.
Changed components
python/src/trezorlib/device.pyTrezor Model One setup flow via trezorlibEntropy check feature in wallet initializationInspect captured patch +10 / −4
diff --git a/python/.changelog.d/+entropy-check-t1.fixed b/python/.changelog.d/+entropy-check-t1.fixed
new file mode 100644
index 00000000..2b636d29
--- /dev/null
+++ b/python/.changelog.d/+entropy-check-t1.fixed
@@ -0,0 +1 @@
+Enable entropy check by default on Trezor Model One with firmware 1.13.1 or newer.
diff --git a/python/src/trezorlib/device.py b/python/src/trezorlib/device.py
index 92afddef..469d1cb9 100644
--- a/python/src/trezorlib/device.py
+++ b/python/src/trezorlib/device.py
@@ -47,6 +47,7 @@ RECOVERY_BACK = "\x08" # backspace character, sent literally
SLIP39_EXTENDABLE_MIN_VERSION = (2, 7, 1)
ENTROPY_CHECK_MIN_VERSION = (2, 8, 7)
+ENTROPY_CHECK_MIN_VERSION_T1 = (1, 13, 1)
HOMESCREEN_STREAMING_MIN_VERSION = (2, 8, 11)
@@ -361,8 +362,9 @@ def setup(
Returned XPUBs are in the form of tuples (derivation path, xpub).
Specifying an entropy check count other than 0 on devices that don't support it,
- such as Trezor Model One, will result in an error. If not specified, a random value
- between 2 and 8 is chosen on supporting devices.
+ i.e. firmware older than 1.13.1 for Trezor Model One or older than 2.8.7 for the
+ core family, will result in an error. If not specified, a random value between 2 and
+ 8 is chosen on supporting devices.
Args:
* client: TrezorClient instance.
@@ -405,8 +407,11 @@ def setup(
paths = [parse_path("m/84h/0h/0h"), parse_path("m/44h/60h/0h")]
if entropy_check_count is None:
- if session.version < ENTROPY_CHECK_MIN_VERSION:
- # includes Trezor One 1.x.x
+ if session.features.model == "1":
+ min_version = ENTROPY_CHECK_MIN_VERSION_T1
+ else:
+ min_version = ENTROPY_CHECK_MIN_VERSION
+ if session.version < min_version:
entropy_check_count = 0
else:
entropy_check_count = random.randint(2, 8)
Why this scored 33/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.