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

keystore: get_private_keys should not return None

Public commit record

What the developer wrote

Authored by SomberNight

68/100 · Adequate
keystore: get_private_keys should not return None

closes https://github.com/spesmilo/electrum/issues/10200
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a small but real bug in Electrum's handling of private key imports. Previously, when a user pasted an empty or invalid list of private keys, the function returned 'None' (meaning 'nothing'). Some parts of the code treated 'None' as if keys were present, which could let an empty or invalid import proceed unexpectedly. The fix makes the function return an empty list instead, so callers correctly recognize there are no valid keys. The direct security impact is limited because the user still has to initiate an import and supply input, but it removes a logic trap that could mishandle private key material.

Recommended action

Treat as a low-severity hardening fix. Review related callers of get_private_keys to ensure no other code still relies on None semantics. No urgent patch deployment required, but include in normal release cycle.

Security signals we found

01

Return-value sentinel bug: None vs empty list confusion

02

Private key import code path affected

03

UI validation logic changed to use bool() instead of 'is not None'

04

Type annotation tightened from Optional[Sequence[str]] to Sequence[str]

05

Issue reference #10200 suggests user-reported bug

Risk score

Why this scored 33/100

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