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
Require minimally-encoded features in BOLT 11 invoices
When decoding BOLT 11 invoices, LDK has always read them into
fields, parsing what it can. When parsing features, this loses the
information on the number of field elements which were used to
encode the features in the invoice itself.
When we then go to calculate a hash of the invoice for signature
validation/key recovery, we go re-serialize the invoice. At this
point, any excess field elements used to encode features will be
lost and the invoice's hash will be different from what the
original encoder intended.
Luckily, this doesn't appear to have ever happened in practice.
This was, in fact, only found by @erickcestari, @brunoerg, and
@morehouse when doing differential fuzzing.
Because this hasn't happened and it breaks a straightforward way to
handle BOLT 11 parsing, there's no reason to retain it, so instead
here we simply forbid non-minimally-encoded features in BOLT 11
invoices.
See lightningdevkit/rust-lightning#3693
for the specific example generated by fuzzing.
0 commit comments