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

commands: add clear error that plugin commands cannot be run with -o

Public commit record

What the developer wrote

Authored by SomberNight

73/100 · Adequate
commands: add clear error that plugin commands cannot be run with -o

note that atm none of the plugin commands are explicitly marked with 'n' but all require it.
Also note that 'w' for plugin commands kind of implies 'n' anyway, as the 'load_wallet' hook relies on having a daemon.

```
$ ./run_electrum -o --testnet labels_pull
Password:
1.96 | E | __main__ | error running command (without daemon)
Traceback (most recent call last):
File "/home/user/wspace/electrum/./run_electrum", line 587, in handle_cmd
result = fut.result()
File "/usr/lib/python3.13/concurrent/futures/_base.py", line 456, in result
return self.__get_result()
~~~~~~~~~~~~~~~~~^^
File "/usr/lib/python3.13/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/home/user/wspace/electrum/./run_electrum", line 267, in run_offline_command
result = await func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/wspace/electrum/electrum/commands.py", line 202, in func_wrapper
return await func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/wspace/electrum/electrum/commands.py", line 2214, in func_wrapper
kwargs['plugin'] = daemon._plugins.get_plugin(plugin_name)
^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute '_plugins'
```
✓ 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 crash in Electrum's command-line tool. When a user ran a plugin-provided command in offline mode (using the -o flag), the program tried to access a daemon object that didn't exist, causing an ugly AttributeError. The patch makes two changes: it automatically marks all plugin commands as requiring a daemon, and it adds an explicit check so the program fails cleanly if a plugin command is somehow run without a daemon. This is a robustness/usability fix rather than a security vulnerability.

Recommended action

No urgent action needed. This is a minor hardening/UX fix. Users and downstream packagers can treat it as a routine bugfix. If backporting, include it with other CLI robustness improvements.

Security signals we found

01

Crash/DoS-like condition in CLI from unhandled AttributeError

02

Defensive assertion added to prevent null pointer dereference equivalent

03

No evidence of malicious exploitation path

Risk score

Why this scored 22/100

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