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

wallet: sign_message: strip whitespaces in GUIs, do not strip in CLI

Public commit record

What the developer wrote

Authored by SomberNight

96/100 · Strong
wallet: sign_message: strip whitespaces in GUIs, do not strip in CLI

- stripping whitespaces leads to better UX for GUIs IMO, but it's counter-productive for CLI
- our previous behaviour was unintentionally inconsistent:
- qt stripped the message in both sign and verify
- qml stripped the message in verify but not in sign (until #10787)
- cli stripped the message in both sign and verify
- qml also stripped the signature in verify, which was not done anywhere else
- now this code is de-duped, and the default becomes stripping both message and signature; with the CLI explicitly opting out of that

ref https://github.com/spesmilo/electrum/issues/4327
closes https://github.com/spesmilo/electrum/pull/10787
closes https://github.com/spesmilo/electrum/pull/10788
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit tidies up how Electrum handles extra spaces around Bitcoin addresses, messages, and signatures when signing or verifying messages. Previously, different parts of the program (desktop GUI, mobile-style GUI, command line) behaved inconsistently—some trimmed spaces automatically, others did not. The change moves the trimming into the shared wallet code and makes it the default for GUIs, while the command-line tool now explicitly keeps spaces untouched. It is a user-experience and consistency fix, not a patch for an active security vulnerability.

Recommended action

No immediate security action required. Treat as a routine UX/consistency improvement. If auditing, confirm that downstream callers relying on exact whitespace behavior (scripts, plugins, tests) are updated to pass strip_inputs=False where needed.

Security signals we found

01

Behavior normalization across GUI and CLI interfaces

02

No cryptographic primitive changed

03

No privilege boundary crossed

04

No input validation removed; whitespace handling moved to shared layer

05

References prior UX issue #4327 and community PRs #10787/#10788

Risk score

Why this scored 19/100

Our methodology →
Potential impact 2/30
Exploitability 1/25
Stealth signal 1/15
Affected reach 3/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.