From 0b7fa9cd99dc18cf5e6c6cfca3fafb19532d124b Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Thu, 4 Jan 2024 12:34:17 +0100 Subject: [PATCH] bip21: fail bip21 uri if unsupported req-* parameter is present. fixes #8781 --- electrum/bip21.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/electrum/bip21.py b/electrum/bip21.py index bcf6bd361..6b9cdf2fc 100644 --- a/electrum/bip21.py +++ b/electrum/bip21.py @@ -43,6 +43,9 @@ def parse_bip21_URI(uri: str) -> dict: for k, v in pq.items(): if len(v) != 1: raise InvalidBitcoinURI(f'Duplicate Key: {repr(k)}') + if k.startswith('req-'): + # we have no support for any req-* query parameters + raise InvalidBitcoinURI(f'Unsupported Key: {repr(k)}') out = {k: v[0] for k, v in pq.items()} if address: