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

plugin: make DeviceMgr.run non-blocking, fix lock

Public commit record

What the developer wrote

Authored by f321x

68/100 · Adequate
plugin: make DeviceMgr.run non-blocking, fix lock

Prevents `DeviceMgr.run()` from blocking the `Plugins` `DaemonThread` by
scheduling the hww timeout check instead of awaiting its result on the
`Plugins` thread.

If something in the `_hwd_comms_executor` thread is waiting for user
input, e.g. when setting up a hww in the wizard the user needs to
unlock the hww for `HardwareClientBase.get_xpub()` to return, the
`_hwd_comms_executor` is blocked. If then `DeviceMgr.run()` gets called by
the `Plugins` `DaemonThread` concurrently and tries to check the hww
timeout on the `_hwd_comms_executor` as well the `DaemonThread` is
blocked too until the `_hwd_comms_executor` gets unblocked (and the
`DaemonThread.job_lock` is taken.

Now if something tries to take the `DaemonThread.job_lock` it blocks as
well, so if a user e.g. tries to load a new plugin from the plugins
dialog the whole gui thread will freeze until the hww gets unlocked.
✓ 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 bug where Electrum's background plugin thread could freeze while waiting for a hardware wallet to be unlocked. The fix moves the timeout check onto a separate executor thread so the main background thread stays responsive. A side effect is that the GUI no longer freezes when loading plugins while a hardware wallet is waiting for user input. There is no direct evidence this is a security vulnerability, but thread-blocking bugs can sometimes be abused to create denial-of-service conditions.

Recommended action

Treat as a stability and UX fix. Review whether the blocking behavior could be triggered by an attacker with local access or a malicious plugin; if so, consider a security advisory. Otherwise, include in regular release notes as a bug fix.

Security signals we found

01

Fixes thread-blocking / lock contention issue

02

DaemonThread.job_lock contention could freeze GUI

03

Potential local denial-of-service via hardware wallet user interaction

04

No explicit security disclosure in commit message

Risk score

Why this scored 46/100

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