tx.file: require have_wif field to be absent for transaction outputs
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.
This commit is contained in:
parent
1d96c17b2f
commit
fa0d2a631c
1 changed files with 4 additions and 0 deletions
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in a new issue