Skip to content

ConvertToRegularAccount with a wrong password half-converts the profile #7699

Description

@glitchminer

Not reachable from the Status client.
The client does not take this password from the user. It derives it from the mnemonic (keycard_convert_account.nim:34-36), and a wrong mnemonic fails at login first. Filing this as an API-boundary observation, not a user-facing bug.

What happens:
ConvertToRegularAccount does not verify currPassword before it changes state.
ensureDBsOpened (pkg/backend/geth_backend.go:1626) passes the password down but never uses it while a session is open — ensureAppDBOpened (:532) and ensureWalletDBOpened (:592) both return early when the handle is already set.

The function then clears KeycardPairing (:1636) and recreates the keystore files (:1641), encrypting them with the unverified password. Only the final ChangeDatabasePassword fails.

The result is a mixed state: pairing cleared, keystore files that open only with the wrong password, database password still the keycard one, app DB closed by the failure.

Steps to reproduce (Go test calling the backend directly: not a client flow)

  1. Convert a profile to keycard (ConvertToKeycardAccount, normal flow).
  2. Stay logged in.
  3. Call ConvertToRegularAccount with the correct mnemonic and a wrong currPassword.

Observed (develop bd4201f95):
error failed to set journal_mode pragma: file is not a database from the last step only. Afterwards: KeycardPairing is ""; 3 keystore files exist and open only with the wrong password; VerifyDatabasePassword succeeds only with the keycard password; appDB is nil.

Suggested: verify the password before any state change.

Close this if the team's position is that callers own validation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status
    QA

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions