Merge pull request #704 from Foundation-Devices/SFT-7937-warn-one-of-n-multisig
What changed, and why it matters
This commit adds a user-interface warning when a Passport hardware wallet is used with a 1-of-N multisig wallet. In such wallets, any single cosigner can move funds without the Passport's approval, so the device now displays a notice before signing. It is a transparency/usability improvement, not a fix for a code vulnerability.
No immediate action required; treat as a normal feature/usability improvement. Users relying on 1-of-N multisig should be aware of the reduced quorum requirement, which this commit now surfaces.
Security signals we found
Adds explicit user warning for 1-of-N multisig configuration
Warning is shown on every spend, including self-sends and no-change transactions
Unit tests verify warning text and routing behavior
Evidence from the diff
The change inserts a warning into psbtObject.consider_outputs() whenever active_multisig.M == 1 and active_multisig.N > 1. The warning is appended to self.warnings and later rendered during PSBT review. A unit test exercises multiple policy and change-output combinations, asserting the warning appears only for 1-of-N (N>1) multisigs and that the warning page flow routes to sign or back based on user approval.
Changed components
ports/stm32/boards/Passport/modules/psbt.pyports/stm32/boards/Passport/modules/tests/test_unit.pyports/stm32/boards/Passport/modules/tests/unit/one_of_n_warning.pyInspect captured patch +143 / −0
### ports/stm32/boards/Passport/modules/psbt.py
@@ -1291,6 +1291,16 @@ def consider_outputs(self):
for out_idx, txo in self.output_iter():
pass
+ # A change script containing our key does not give us exclusive control
+ # when any one of several cosigners can spend it. Keep existing wallets
+ # usable, but disclose this on every spend, including self-sends and
+ # transactions with no change output.
+ if self.active_multisig and self.active_multisig.M == 1 and self.active_multisig.N > 1:
+ self.warnings.append(
+ ('1-of-{} Multisig'.format(self.active_multisig.N),
+ 'Any other cosigner can spend funds in this wallet, including change, '
+ 'without approval from this wallet.'))
+
# check fee is reasonable
total_non_change_out = self.total_value_out - total_change
# print('total_non_change_out={} self.total_value_out={} total_change={}'.format(total_non_change_out,
### ports/stm32/boards/Passport/modules/tests/test_unit.py
@@ -64,6 +64,10 @@ def test_psbt_multisig_approval(test):
assert test('psbt_multisig_approval.py') == b'OK'
+def test_one_of_n_warning(test):
+ assert test('one_of_n_warning.py') == b'OK'
+
+
def test_seedqr_codec(test):
assert test('seedqr_codec.py') == b'OK'
### ports/stm32/boards/Passport/modules/tests/unit/one_of_n_warning.py
@@ -0,0 +1,129 @@
+# SPDX-FileCopyrightText: © 2026 Foundation Devices, Inc. <hello@foundation.xyz>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# Exercise imported PSBT review methods in the standard simulator harness.
+
+import pages
+import uasyncio as asyncio
+from psbt import psbtObject
+from serializations import CTxOut
+from flows.sign_psbt_common_flow import SignPsbtCommonFlow
+
+
+class MockWallet:
+ def __init__(self, policy):
+ self.M, self.N = policy
+
+
+class MockOutput:
+ def __init__(self, is_change):
+ self.is_change = is_change
+ self.validations = []
+
+ def validate(self, *args):
+ self.validations.append(args)
+
+
+class MockPSBT:
+ my_xfp = 123
+ total_value_out = 1000
+ fee_is_verified = True
+
+ def __init__(self, policy, change):
+ self.active_multisig = MockWallet(policy) if policy else None
+ self.outputs = [MockOutput(False)]
+ self.values = [1000]
+ if change is not None:
+ self.outputs.append(MockOutput(True))
+ self.values = [1000 - change, change]
+ self.warnings = []
+ self.self_send = False
+ self.change_checks = []
+
+ def output_iter(self):
+ for index, value in enumerate(self.values):
+ yield index, CTxOut(value, b'')
+
+ def calculate_fee(self):
+ return 1
+
+ def consider_dangerous_change(self, xfp):
+ self.change_checks.append(xfp)
+
+
+class MockChain:
+ def render_value(self, value):
+ return str(value), 'sats'
+
+
+class MockFlow:
+ chain = MockChain()
+ header = 'Transaction Info'
+ sign_transaction = 'sign'
+ render_warnings = SignPsbtCommonFlow.render_warnings
+
+ def __init__(self, psbt):
+ self.psbt = psbt
+ self.events = []
+
+ def back(self):
+ self.events.append('back')
+
+ def goto(self, state):
+ self.events.append(state)
+
+
+# None means there is no change output at all; zero retains a zero-value one.
+for policy in (None, (1, 1), (1, 2), (1, 15), (2, 3), (3, 3)):
+ for change in (None, 0, 500, 1000):
+ psbt = MockPSBT(policy, change)
+ psbtObject.consider_outputs(psbt)
+ assert len(psbt.outputs) == (1 if change is None else 2)
+ for index, output in enumerate(psbt.outputs):
+ assert len(output.validations) == 1
+ idx, txo, xfp, wallet = output.validations[0]
+ assert idx == index and txo.nValue == psbt.values[index]
+ assert xfp == psbt.my_xfp and wallet is psbt.active_multisig
+ assert psbt.change_checks == [psbt.my_xfp]
+ assert psbt.self_send == (change == 1000)
+ expected = policy is not None and policy[0] == 1 and policy[1] > 1
+ assert len(psbt.warnings) == int(expected)
+ if expected:
+ text = MockFlow(psbt).render_warnings()
+ assert '1-of-{} Multisig'.format(policy[1]) in text
+ assert 'Any other cosigner can spend' in text
+ assert 'including change' in text
+ assert 'without approval from this wallet' in text
+
+
+class MockPage:
+ approve = False
+ flow = None
+
+ def __init__(self, text, **kwargs):
+ assert text == self.flow.render_warnings()
+ assert '1-of-2 Multisig' in text
+
+ async def show(self):
+ self.flow.events.append('review')
+ return self.approve
+
+
+async def run_tests():
+ original_page = pages.LongTextPage
+ try:
+ pages.LongTextPage = MockPage
+ for approve in (False, True):
+ psbt = MockPSBT((1, 2), None)
+ psbtObject.consider_outputs(psbt)
+ flow = MockFlow(psbt)
+ MockPage.flow = flow
+ MockPage.approve = approve
+ await SignPsbtCommonFlow.show_warnings(flow)
+ assert flow.events == ['review', 'sign' if approve else 'back']
+ finally:
+ pages.LongTextPage = original_page
+
+
+asyncio.run(run_tests())
+return_value.write(b'OK')Why this scored 20/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.