What changed, and why it matters
This commit changes how Electrum's message-signing function is called so that callers must explicitly name each argument (address, message, password) rather than passing them by position. The main practical effect is to prevent accidental mix-ups of argument order, which could lead to signing the wrong message or using the wrong credentials. There is no direct evidence in the commit that this fixes an active security bug or reported vulnerability.
Treat as routine defensive maintenance. No urgent action required unless an independent advisory links this change to a specific vulnerability.
Security signals we found
API hardening: keyword-only arguments prevent positional argument swap
No explicit security bug fix or vulnerability disclosure in commit message or diff
No changes to cryptographic logic, password handling, or message parsing
Evidence from the diff
The patch converts Abstract_Wallet.sign_message to a keyword-only signature by adding * before its parameters, and updates all three call sites (CLI commands, Qt GUI, QML GUI) to use named arguments. This is a defensive hardening change: it eliminates positional-argument confusion and makes future API misuse harder. The diff does not show any exploitable vulnerability being patched, nor any incident disclosure or CVE reference.
Changed components
electrum/wallet.pyelectrum/commands.pyelectrum/gui/qt/main_window.pyelectrum/gui/qml/qewallet.pyInspect captured patch +9 / −4
diff --git a/electrum/commands.py b/electrum/commands.py
index 660a2c7..beaaa43 100644
--- a/electrum/commands.py
+++ b/electrum/commands.py
@@ -918,7 +918,7 @@ class Commands(Logger):
raise UserFacingException(f"address must be a str instead of {type(address)}")
if not isinstance(message, str):
raise UserFacingException(f"message must be a str instead of {type(message)}")
- sig = wallet.sign_message(address, message, password)
+ sig = wallet.sign_message(address=address, message=message, password=password)
return base64.b64encode(sig).decode('ascii')
@command('')
diff --git a/electrum/gui/qml/qewallet.py b/electrum/gui/qml/qewallet.py
index f525636..5d3e233 100644
--- a/electrum/gui/qml/qewallet.py
+++ b/electrum/gui/qml/qewallet.py
@@ -852,7 +852,7 @@ class QEWallet(AuthMixin, QObject, QtEventListener):
address = address.strip()
message = message.strip()
try:
- sig = self.wallet.sign_message(address, message, self.password)
+ sig = self.wallet.sign_message(address=address, message=message, password=self.password)
except UserFacingException as e:
self.signMessageError.emit(str(e))
return
diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py
index 306da47..c8c8ed9 100644
--- a/electrum/gui/qt/main_window.py
+++ b/electrum/gui/qt/main_window.py
@@ -2134,7 +2134,12 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener):
) -> None:
address = address_e.text().strip()
message = message_e.toPlainText().strip()
- task = partial(self.wallet.sign_message, address, message, password)
+ task = partial(
+ self.wallet.sign_message,
+ address=address,
+ message=message,
+ password=password,
+ )
def show_signed_message(sig):
try:
diff --git a/electrum/wallet.py b/electrum/wallet.py
index eb3c628..1a72de1 100644
--- a/electrum/wallet.py
+++ b/electrum/wallet.py
@@ -3234,7 +3234,7 @@ class Abstract_Wallet(ABC, Logger, EventListener):
def _update_password_for_keystore(self, old_pw: Optional[str], new_pw: Optional[str]) -> None:
pass
- def sign_message(self, address: str, message: str, password) -> bytes:
+ def sign_message(self, *, address: str, message: str, password) -> bytes:
"""Caller must handle UserFacingException."""
assert isinstance(address, str), f"address must be str. got {type(address)}"
assert isinstance(message, str), f"message must be str. got {type(message)}"
Why this scored 29/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.