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

lnurl: only sanitize untrusted LNURL errors

Public commit record

What the developer wrote

Authored by f321x

60/100 · Adequate
lnurl: only sanitize untrusted LNURL errors

it is not neccessary to sanitize all LNURLErrors as most are just source
strings.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
The short version

What changed, and why it matters

This commit tightens how Electrum handles error messages coming from external LNURL services. Previously, every LNURL error was wrapped with a 'do not trust this message' warning. The change splits those errors into two kinds: errors generated from Electrum's own code now display normally, while only errors returned by untrusted LNURL servers are sanitized and flagged as untrusted. It also applies a text-safety utility to the server-provided message before showing it to the user, reducing the chance that a malicious or compromised LNURL server could trick a user through a crafted error string.

Recommended action

Review util.error_text_str_to_safe_str to confirm it covers the intended threat model (e.g., HTML/markup injection, line-break spoofing, RTL override characters). Ensure all future call sites that raise on remote LNURL data use UntrustedLNURLError consistently. Consider adding unit tests that verify UntrustedLNURLError sanitizes server-controlled strings and that local errors are not decorated.

Security signals we found

01

Untrusted external input is now explicitly sanitized before UI display

02

Exception hierarchy distinguishes local errors from server-returned errors

03

Commit message frames change as a security-relevant hardening measure

04

New dependency on util.error_text_str_to_safe_str suggests prior concern about unsafe text rendering

Risk score

Why this scored 50/100

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