AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Moderate 60 Bitcoin

Merge pull request #10970 from f321x/fix_bolt11_bugs_2

Public commit record

What the developer wrote

Authored by ghost43

58/100 · Thin
Merge pull request #10970 from f321x/fix_bolt11_bugs_2

bolt11: bugfixes and cleanup
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Links an issue, advisory, or supporting reference! No meaningful explanatory body
The short version

What changed, and why it matters

This commit fixes several bugs in Electrum's handling of BOLT11 Lightning invoices. The most user-visible fixes are: stricter validation of invoice amounts (rejecting zero, negative, sub-millisatoshi, and leading-zero amounts), correct padding of the timestamp field so small dates don't get corrupted, preserving the 'n' (public key) tag when decoding so re-encoding doesn't silently drop it, and removing support for the non-standard 't' routing tag that could previously hide malformed data. There is also a fix to how description fields are truncated so they don't produce invalid UTF-8. These are correctness and robustness fixes rather than a single critical vulnerability, but they could have allowed malformed or ambiguous invoices to be accepted or re-encoded incorrectly.

Recommended action

Review and merge if not already merged; run the expanded test suite; consider whether any previously accepted malformed invoices in user wallets need the storage upgrade path already included. No immediate emergency response is indicated, but users should upgrade to a version containing this fix to avoid handling of non-conformant BOLT11 invoices.

Security signals we found

01

Stricter BOLT11 amount validation prevents acceptance of zero, negative, sub-millisatoshi, and leading-zero amounts

02

Fixed int_to_data5 padding bug that corrupted small timestamp values during invoice round-trip

03

Malformed 'r' routing tags now raise exceptions instead of being silently skipped

04

Non-standard 't' routing tag support removed, reducing attack surface

05

'n' pubkey tag now preserved on decode, preventing silent information loss on re-encoding

06

Description truncation now avoids invalid UTF-8 byte sequences

07

Storage upgrade conversion drops previously stored invoices with malformed route tags to prevent wallet load failures

08

Amount setter now rejects zero and NaN, preventing creation of invalid invoices

Risk score

Why this scored 60/100

Our methodology →
Potential impact 18/30
Exploitability 12/25
Stealth signal 8/15
Affected reach 10/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.