fix(core): disable unused THP pairing methods
What changed, and why it matters
This commit removes two unused Bluetooth pairing methods (QR code and NFC) from the default list in Trezor's new 'THP' transport layer, leaving only the code-entry method active in normal builds. In debug/test builds, the removed methods are still available so internal tests can keep running. The change is framed as a cleanup of unfinished features, not as a response to a known security bug.
Treat as a defensive hardening change. Monitor issues #6036, #6037, and #6038 for completion of QR-code and NFC pairing implementations before re-enabling them in production. Verify that `__debug__` builds are not shipped to end users, since they retain the disabled methods.
Security signals we found
Reduction of attack surface by disabling unused pairing mechanisms in production builds
Debug-only re-enablement of disabled pairing methods for test coverage
TODO comments linking to follow-up issues, suggesting feature is incomplete rather than a vulnerability fix
Evidence from the diff
The patch changes core/src/trezor/wire/thp/__init__.py. _DEFAULT_ENABLED_PAIRING_METHODS is reduced from CodeEntry, QrCode, NFC to only CodeEntry. Under __debug__, SkipPairing, NFC, and QrCode are appended so test suites (test_pairing_nfc, test_pairing_qr_code) still execute. UI test fixture hashes for test_pairing_code_entry and test_pairing_code_entry_cancel are updated across locales, reflecting a changed screen flow now that the default list no longer contains the other methods. The commit message and added TODO comments reference GitHub issues #6036, #6037, #6038, indicating these methods are not yet ready for production.
Changed components
core/src/trezor/wire/thp/__init__.pytests/ui_tests/fixtures.jsonInspect captured patch +21 / −15
diff --git a/core/src/trezor/wire/thp/__init__.py b/core/src/trezor/wire/thp/__init__.py
index 597433ecd..9a8c3126f 100644
--- a/core/src/trezor/wire/thp/__init__.py
+++ b/core/src/trezor/wire/thp/__init__.py
@@ -174,9 +174,8 @@ class PacketHeader:
_DEFAULT_ENABLED_PAIRING_METHODS = [
- ThpPairingMethod.CodeEntry,
- ThpPairingMethod.QrCode,
- ThpPairingMethod.NFC,
+ # TODO: Add pairing methods https://github.com/trezor/trezor-firmware/issues/6036
+ ThpPairingMethod.CodeEntry
]
@@ -190,6 +189,13 @@ def get_enabled_pairing_methods(
methods = _DEFAULT_ENABLED_PAIRING_METHODS.copy()
if __debug__:
methods.append(ThpPairingMethod.SkipPairing)
+ methods.append( # Used only in tests, TODO: https://github.com/trezor/trezor-firmware/issues/6037
+ ThpPairingMethod.NFC
+ )
+ methods.append( # Used only in tests, TODO: https://github.com/trezor/trezor-firmware/issues/6038
+ ThpPairingMethod.QrCode
+ )
+
return methods
diff --git a/tests/ui_tests/fixtures.json b/tests/ui_tests/fixtures.json
index cfcdefd66..f05e80e67 100644
--- a/tests/ui_tests/fixtures.json
+++ b/tests/ui_tests/fixtures.json
@@ -30968,8 +30968,8 @@
"T3W1_cs_thp-test_pairing.py::test_credential_request_in_encrypted_transport_phase": "7b97a23531342775f0318a74d41becacd269e51a543b12656923763269a2f22f",
"T3W1_cs_thp-test_pairing.py::test_pairing_cancel_1": "1483b32f7c93c627e805fdfa620ff95018d1f99c0d141e670077ceb240b1243d",
"T3W1_cs_thp-test_pairing.py::test_pairing_cancel_2": "a5cac060747b4be07468c92002563e15b0f6dbb6b65ea3d741a3321c12a4460d",
-"T3W1_cs_thp-test_pairing.py::test_pairing_code_entry": "85c882aef035c3ae41b12b912ea3f4e0330d8ecb39e0298dd7debb1e21f0697d",
-"T3W1_cs_thp-test_pairing.py::test_pairing_code_entry_cancel": "85c882aef035c3ae41b12b912ea3f4e0330d8ecb39e0298dd7debb1e21f0697d",
+"T3W1_cs_thp-test_pairing.py::test_pairing_code_entry": "e9d810e2811aa18fbc87cb4f3d4f99812b4c8cc68838a008e3564b4a11adccef",
+"T3W1_cs_thp-test_pairing.py::test_pairing_code_entry_cancel": "e9d810e2811aa18fbc87cb4f3d4f99812b4c8cc68838a008e3564b4a11adccef",
"T3W1_cs_thp-test_pairing.py::test_pairing_nfc": "613bcea2556dddf79d2394f5c5609235f7bde128fd21f6409613043f1a7d4657",
"T3W1_cs_thp-test_pairing.py::test_pairing_qr_code": "c24521e569c08e3605b164212c876f8ac57c5eef6cca6f2ca53a635a883ebc4b",
"T3W1_cs_webauthn-test_msg_webauthn.py::test_add_remove": "41e0ff0345000141e896ac5e1b7efccba213037de18b5eb8c0882be670034b18",
@@ -32469,8 +32469,8 @@
"T3W1_de_thp-test_pairing.py::test_credential_request_in_encrypted_transport_phase": "7833feed00c2236903c9eb2e66788c2a28199e3f090ab6c6308be8ad8b7fa14c",
"T3W1_de_thp-test_pairing.py::test_pairing_cancel_1": "2f7a8459b66ad064e3c2954c9e4454c83ee51176d6fb4344897ed7c244306ce4",
"T3W1_de_thp-test_pairing.py::test_pairing_cancel_2": "fe6296e82b0d14758c9c855ba5de4ff222c738f951e26d04fee14a5a48814cdc",
-"T3W1_de_thp-test_pairing.py::test_pairing_code_entry": "5b5722bafd65b8382c93f73f774f3394f80b05e7755a347fd82b55f3918d0bac",
-"T3W1_de_thp-test_pairing.py::test_pairing_code_entry_cancel": "5b5722bafd65b8382c93f73f774f3394f80b05e7755a347fd82b55f3918d0bac",
+"T3W1_de_thp-test_pairing.py::test_pairing_code_entry": "3f25efb7675ca9631913c36e12b4a8455968b5cc0d9324625030097b773af95d",
+"T3W1_de_thp-test_pairing.py::test_pairing_code_entry_cancel": "3f25efb7675ca9631913c36e12b4a8455968b5cc0d9324625030097b773af95d",
"T3W1_de_thp-test_pairing.py::test_pairing_nfc": "f0ad4b3d776c076dab666cc0e6ef7ac8261d98eba206c5089eb1bcd5f5aa0afc",
"T3W1_de_thp-test_pairing.py::test_pairing_qr_code": "98735f888f827501b25c78c6a737c1983a800c620f709c65b1d95f6c8c9a2b90",
"T3W1_de_webauthn-test_msg_webauthn.py::test_add_remove": "615265e559145574c93bf984fedbfffebea4f9b257d381f6f2c59afc6de60f26",
@@ -33970,8 +33970,8 @@
"T3W1_en_thp-test_pairing.py::test_credential_request_in_encrypted_transport_phase": "d9d06c263ad3d67de0662b7d07c91a9ef4ab7b21c25f8f7c5a9eef233276ff81",
"T3W1_en_thp-test_pairing.py::test_pairing_cancel_1": "cd8b89c41f1fa45320970832327c3626a281f2f9c37f8d043e48878d63f7553a",
"T3W1_en_thp-test_pairing.py::test_pairing_cancel_2": "554f7a5c9236a8ec9f1cebbaa0e56e057c862f1e37b3b796879c54b5f4f60db9",
-"T3W1_en_thp-test_pairing.py::test_pairing_code_entry": "cb3668ad56109ff1d881b04ede0f72ee79ee4490ab2bc29d80c35d35227112c0",
-"T3W1_en_thp-test_pairing.py::test_pairing_code_entry_cancel": "cb3668ad56109ff1d881b04ede0f72ee79ee4490ab2bc29d80c35d35227112c0",
+"T3W1_en_thp-test_pairing.py::test_pairing_code_entry": "18a7e6a2e73fb8fc6e0e26368c1e26ff8c32d50766dce87da64fe9c8a5fefa0c",
+"T3W1_en_thp-test_pairing.py::test_pairing_code_entry_cancel": "18a7e6a2e73fb8fc6e0e26368c1e26ff8c32d50766dce87da64fe9c8a5fefa0c",
"T3W1_en_thp-test_pairing.py::test_pairing_nfc": "a35f27a25123e935371966b194c0221d93139450f612a63518f5f5a5865d30d1",
"T3W1_en_thp-test_pairing.py::test_pairing_qr_code": "931d9afceb0ba1e4faae891775819277242d889644d5c0c5863fc8c9fcf859b1",
"T3W1_en_webauthn-test_msg_webauthn.py::test_add_remove": "222e1dc521b9a3ccfb91530fd9246664a62a102f1595b78b7207ec9348036017",
@@ -35471,8 +35471,8 @@
"T3W1_es_thp-test_pairing.py::test_credential_request_in_encrypted_transport_phase": "f88136b7237c5f8fc5344d82573a6dfa1bd3409eafaf1afe77bbc9dbc2a3cf60",
"T3W1_es_thp-test_pairing.py::test_pairing_cancel_1": "028d63c695abceafd5b94d8918d3fdcc47739fc52d23e335468be473a60dba01",
"T3W1_es_thp-test_pairing.py::test_pairing_cancel_2": "f726e1f2cc1799a63bb83373fb9f34fb72474751e57134da0c1702c582f84fd0",
-"T3W1_es_thp-test_pairing.py::test_pairing_code_entry": "1f1871263cc8aa25d5f63c2bfee8b573bba3b08edbc0ed81973783742efb8bc5",
-"T3W1_es_thp-test_pairing.py::test_pairing_code_entry_cancel": "1f1871263cc8aa25d5f63c2bfee8b573bba3b08edbc0ed81973783742efb8bc5",
+"T3W1_es_thp-test_pairing.py::test_pairing_code_entry": "541384aaeaddf4d94a411082aac3b5e272abed8be2c008870a16b0cec0c95c2b",
+"T3W1_es_thp-test_pairing.py::test_pairing_code_entry_cancel": "541384aaeaddf4d94a411082aac3b5e272abed8be2c008870a16b0cec0c95c2b",
"T3W1_es_thp-test_pairing.py::test_pairing_nfc": "f6ec6f54fd638746b170fbed5f0ac16a1c134e2bbd5711c794e5a37507c5c3c1",
"T3W1_es_thp-test_pairing.py::test_pairing_qr_code": "56536ae9cd7c4ff8022def4ec3350031d3614064d961f53a2850f2be425af201",
"T3W1_es_webauthn-test_msg_webauthn.py::test_add_remove": "85d81bed1998bbca18bbe3069c7fa7a419ea29de0d2b8f9feed5e965c2c6d5cb",
@@ -36972,8 +36972,8 @@
"T3W1_fr_thp-test_pairing.py::test_credential_request_in_encrypted_transport_phase": "b986b27033b991f2c259d1024b5bcf9a38b0f4d126474e887f5c7b65c099fe63",
"T3W1_fr_thp-test_pairing.py::test_pairing_cancel_1": "12004ca1108ea84b42936d997a4be243bcd8459a35a3618f9aaa59c7b9682e83",
"T3W1_fr_thp-test_pairing.py::test_pairing_cancel_2": "b9fd29996cf8fcd33cac4a3c8577454109b49a831c485ffa6c2adbb0bad928bb",
-"T3W1_fr_thp-test_pairing.py::test_pairing_code_entry": "7d58025ea79f53675e7c6848d204fcb0aeec7aae5856949fc66af9860c38f034",
-"T3W1_fr_thp-test_pairing.py::test_pairing_code_entry_cancel": "7d58025ea79f53675e7c6848d204fcb0aeec7aae5856949fc66af9860c38f034",
+"T3W1_fr_thp-test_pairing.py::test_pairing_code_entry": "9004655e1d08c3c440cac348a4bd7ce52c6ec777ae94fbf2a26993813b27f5de",
+"T3W1_fr_thp-test_pairing.py::test_pairing_code_entry_cancel": "9004655e1d08c3c440cac348a4bd7ce52c6ec777ae94fbf2a26993813b27f5de",
"T3W1_fr_thp-test_pairing.py::test_pairing_nfc": "96956944ecf8db96ac7fb4a5eeffbafc27f181c49321a5eb67980680acff28f8",
"T3W1_fr_thp-test_pairing.py::test_pairing_qr_code": "e8156cf4eda1d29060f05b4a18d50032b0b344230609b7de7cababfe0a86b20b",
"T3W1_fr_webauthn-test_msg_webauthn.py::test_add_remove": "5346304ff4c3d817f5804c64a656a3bd9e4c353575bb1fcbab46796003f61f64",
@@ -38478,8 +38478,8 @@
"T3W1_pt_thp-test_pairing.py::test_credential_request_in_encrypted_transport_phase": "2732c7eb73f1c271674b61120ef23acb2172eda23308d34acfbab6362e4216fd",
"T3W1_pt_thp-test_pairing.py::test_pairing_cancel_1": "df151c844f9ad2500231de9b092621802026184f6e2bde831f65ec2512d46e1d",
"T3W1_pt_thp-test_pairing.py::test_pairing_cancel_2": "a16fdba151a20b4ccb73e6c5b2413a2ccb7653a78a7cec8750b5d1c5cea926f4",
-"T3W1_pt_thp-test_pairing.py::test_pairing_code_entry": "19bf9c428fda4e4d065aba8f0bc159af03fd8319bec8aa1c340c731ee26af527",
-"T3W1_pt_thp-test_pairing.py::test_pairing_code_entry_cancel": "19bf9c428fda4e4d065aba8f0bc159af03fd8319bec8aa1c340c731ee26af527",
+"T3W1_pt_thp-test_pairing.py::test_pairing_code_entry": "8883f93499df5a5d6c81bfce0d676ddc51140ea4a346b8f2f87be27e94742dc2",
+"T3W1_pt_thp-test_pairing.py::test_pairing_code_entry_cancel": "8883f93499df5a5d6c81bfce0d676ddc51140ea4a346b8f2f87be27e94742dc2",
"T3W1_pt_thp-test_pairing.py::test_pairing_nfc": "8ab7b02cbad200e055dd8930deedf3835a9fc92f130c595df7cb8b2fd5f2bd19",
"T3W1_pt_thp-test_pairing.py::test_pairing_qr_code": "1c74667c078e25e7e0d37c7b2aa35f7c8ab02cd88e74695ecb355c82a293b0cc",
"T3W1_pt_webauthn-test_msg_webauthn.py::test_add_remove": "56cb3438720d4a6f161cafc263d23d8ea2ce40df0af04e9d211c9921a493b19e",
Why this scored 25/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.