Skip to content

scanner: reject duplicate BIP21 parameter keys (#63) - #151

Open
Tyagiquamar wants to merge 1 commit into
synonymdev:masterfrom
Tyagiquamar:fix/bip21-duplicate-params
Open

scanner: reject duplicate BIP21 parameter keys (#63)#151
Tyagiquamar wants to merge 1 commit into
synonymdev:masterfrom
Tyagiquamar:fix/bip21-duplicate-params

Conversation

@Tyagiquamar

Copy link
Copy Markdown

In src/modules/scanner/implementation.rs, decode_onchain() parsed BIP21 URI parameters by collecting them directly into a HashMap<String, String>.

Per BIP-0021 specification, duplicate parameter keys in a URI make the URI invalid. Collecting into a HashMap directly silently dropped earlier duplicate keys, overwriting them with the last key-value pair.

This PR updates query parameter parsing to check for duplicate keys, returning DecodingError::InvalidFormat if duplicate parameter keys are present.

Fixes #63

Testing

  • Added unit test test_duplicate_bip21_params_fails in src/modules/scanner/tests.rs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix : decode is digesting only the first duplicated Bip21

1 participant