tinterface.get_transaction: stricter sanitisation - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 338adf05bad3f39b16d9e1d9f531c4e05b965756 DIR parent 7294613447e9f2857630c4eeb6547c68aad365fc HTML Author: SomberNight <somber.night@protonmail.com> Date: Wed, 27 Jan 2021 20:14:55 +0100 interface.get_transaction: stricter sanitisation in particular, Transaction.__init__ allows leading/trailing whitespaces Diffstat: M electrum/interface.py | 2 ++ 1 file changed, 2 insertions(+), 0 deletions(-) --- DIR diff --git a/electrum/interface.py b/electrum/interface.py t@@ -917,6 +917,8 @@ class Interface(Logger): raise Exception(f"{repr(tx_hash)} is not a txid") raw = await self.session.send_request('blockchain.transaction.get', [tx_hash], timeout=timeout) # validate response + if not is_hex_str(raw): + raise RequestCorrupted(f"received garbage (non-hex) as tx data (txid {tx_hash}): {raw!r}") tx = Transaction(raw) try: tx.deserialize() # see if raises