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

pi: fix incorrectly parsing emaillike with 'ln' prefix

Public commit record

What the developer wrote

Authored by f321x

73/100 · Adequate
pi: fix incorrectly parsing emaillike with 'ln' prefix

Fixes a bug where we incorrectly parsed emaillike payment identifiers as
bech32 lightning payment identifier if they start with a 'ln' prefix.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a bug in Electrum where certain email-like or domain-like payment identifiers that happened to start with the letters 'ln' (such as 'lnbcuser@some.domain') were wrongly treated as Lightning Network invoices. The fix makes the parser check whether the string is actually valid bech32 format before classifying it as a Lightning payment. This could have caused users to send payments to the wrong destination or prevented them from resolving legitimate email/domain payment identifiers.

Recommended action

Review the updated parser logic to confirm bech32_decode correctly rejects all malformed inputs, and consider whether additional URI prefix edge cases (e.g., mixed-case schemes, percent-encoding) need handling. Users should upgrade to a version containing this commit if they rely on Lightning or email/domain payment identifiers.

Security signals we found

01

Parser confusion between email/domain identifiers and Lightning invoices

02

Missing input validation on bech32 structure before Lightning classification

03

Potential UI misrouting of user-entered payment identifiers

04

Test expansion for emaillike/domainlike strings with 'ln' prefix

Risk score

Why this scored 46/100

Our methodology →
Potential impact 12/30
Exploitability 8/25
Stealth signal 7/15
Affected reach 8/15
Confidence 7/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.