From fa0d2a631c286b8b1fd01679d023979621e02ff7 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sun, 22 Nov 2026 09:11:10 +0000 Subject: [PATCH] tx.file: require `have_wif` field to be absent for transaction outputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes a vulnerability whereby an attacker with access to the online machine could bypass the address-belongs-to-wallet test performed by the offline signer by crafting a transaction file with the “have_wif” field set for a transaction output. --- mmgen/tx/file.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mmgen/tx/file.py b/mmgen/tx/file.py index ceb86868..791a9906 100644 --- a/mmgen/tx/file.py +++ b/mmgen/tx/file.py @@ -47,6 +47,10 @@ def eval_io_data(tx, data, *, desc): if not (desc == 'outputs' and tx.proto.base_coin == 'ETH'): # ETH txs can have no outputs assert len(data), f'no {desc}!' for d in data: + if 'have_wif' in d: + raise ValueError( + f'transaction file {desc} contains extraneous ‘have_wif’ field. ' + 'Your online installation may be compromised!') d['amt'] = tx.proto.coin_amt(d['amt']) io, io_list = { 'inputs': (tx.Input, tx.InputList),