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

wallet: don't leave a stale 'use_encryption' flag on enable/disable

Public commit record

What the developer wrote

Authored by Sander van Grieken

73/100 · Adequate
wallet: don't leave a stale 'use_encryption' flag on enable/disable

When disabling the only keystore that could be encrypted (e.g. the keystore
of a standard wallet), 'use_encryption' was left set. Without storage
encryption, the wallet then had no password anymore (has_password() False),
so when re-enabling the keystore, its seed was stored in plaintext, while
has_keystore_encryption() returned True.

Make consistent, and add a note to the confirmation dialog when disabling a
keystore removes the wallet password.
✓ 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 bug in the Electrum Bitcoin wallet where disabling and re-enabling an encrypted keystore could leave the wallet's seed (the secret that controls the coins) stored on disk without a password, while the wallet still falsely claimed the keystore was password-protected. The patch makes the wallet correctly clear the encryption flag when no encryptable keystore remains, and warns the user that disabling will remove the wallet password. A new test also handles wallets that were already affected by the old bug.

Recommended action

Users who previously disabled and re-enabled a keystore in a standard wallet without storage encryption should create a new wallet and move funds, because the seed may have been stored on disk without password protection despite the UI indicating keystore encryption. Update to the patched version.

Security signals we found

01

Plaintext storage of cryptographic seed under certain user actions

02

Inconsistent encryption state flag leading to false security indication

03

Regression tests added for disable/enable keystore encryption transitions

04

User-facing warning added about password removal when disabling keystore

Risk score

Why this scored 69/100

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