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

daemon: forbid "setconfig" command to change rpcserver settings in-flight

Public commit record

What the developer wrote

Authored by SomberNight

86/100 · Strong
daemon: forbid "setconfig" command to change rpcserver settings in-flight

It is much easier to reason about the rpcserver if we don't allow changing its basic settings while it is already running. What does it mean to change the TCP port it is listening on ("rpcport") if it's already running? It is even problematic to change the rpcpassword: care needs to be taken to already update it for the current server.
(ref https://github.com/spesmilo/electrum/issues/6762)

This commit disallows changing all of the "rpc*" config variables if the daemon is already running.

---

Simultaneously, it also ensures rpc_password is always set and auth cannot be disabled.

Previously if there was a daemon running, and the user ran
`$ electrum setconfig rpcpassword ""` that would leave the RPC unauthenticated
for the current session. However next time the daemon restarted, get_rpc_credentials would see
the unset password and generate one.

I think this was the worst of both worlds:
- we did not really allow removing the rpc password, except for the current session, and
- perhaps unexpectedly, we would generate a new password on daemon restart

Instead now we explicitly make sure the RPC server can never get into a state where it does not have a password set.

Based on a report by `Zuzana Kotásková <36777@mail.vsfs.cz>`
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit fixes a security issue in Electrum's background daemon (the program that stays running to serve wallet requests). Previously, a user could run a command that would instantly strip the RPC password from a running daemon, leaving it unauthenticated for the current session. The daemon would then accept commands from any local program without a password. On the next restart, Electrum would silently generate a new random password, which could lock out legitimate tools. The patch now forbids changing RPC server settings while the daemon is running and ensures a password is always required.

Recommended action

Users running Electrum daemon should upgrade to a version containing this commit. Until patched, avoid running 'electrum setconfig rpcpassword ""' or similar commands against a live daemon, and restrict local access to the RPC port/socket. Wallet applications and integrations that rely on the Electrum RPC should verify they are using the configured credentials and not assume authentication can be disabled.

Security signals we found

01

Authentication bypass via empty RPC password

02

In-flight weakening of daemon security settings

03

Inconsistent security state across daemon restart

04

Local privilege escalation / unauthorized local wallet access

05

Patch explicitly forbids live RPC config changes and ensures password is always set

Risk score

Why this scored 63/100

Our methodology →
Potential impact 18/30
Exploitability 14/25
Stealth signal 10/15
Affected reach 9/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.