You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PSBT parser rejects unknown keys with an empty value #560
BIP 174 doesn't set a minimum <valuelen>, and says unknown types should be ignored and passed through. libwally rejects a PSBT whose only unusual field is an unknown output key (0xf0) with an empty value. Bitcoin Core accepts it.
From reading the code: pull_unknown_key_value gets a non-NULL pointer with val_len == 0 from pull_varlength_buff, and map_add rejects it through BYTES_INVALID(val, val_len). That check is still in src/map.c on master (f7b0a15).
Found through bitcoinfuzz, testing at 374df23 with WALLY_PSBT_PARSE_FLAG_STRICT. I only tested an output map key. Global and input unknowns go through the same function, so I'd expect the same there.
Happy to open a PR for this if you'd like, just let me know which approach you'd prefer (handling it in pull_unknown_key_value or in map_add). :)
Activity
jgriffiths commentedon Nov 17, 2026
Hi @bitcoisas thanks for reporting this. Fixed in #562 which I will merge once our internal CI has passed it, cheers!
jgriffiths commentedon Nov 17, 2026
Merged, so closing, thanks again.