Skip to content

ConvertToKeycardAccount saves KeycardPairing before password check #7698

Description

@glitchminer

Not reachable from the Status client.
The client verifies the password before calling (AuthenticationPopup.qml:36-38). Filing this as an API-boundary observation, not a user-facing bug.

What happens:
ConvertToKeycardAccount writes the keycard pairing to the multiaccounts DB as its first action, before anything is validated. If a later step fails, that write is not rolled back.

pkg/backend/geth_backend.go:1311 saves account.KeycardPairing. The next call, ensureDBsOpened (:1316), passes oldPassword down but never uses it while a session is open — ensureAppDBOpened (:532) and ensureWalletDBOpened (:592) both return early when the DB handle is already set. So the first real password check happens later, inside the keypair migration.

After a failed call, RefersToKeycard() returns true for an account that is not on a keycard.

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

  1. Log in to a password-based profile.
  2. Call ConvertToKeycardAccount with an account whose KeycardPairing is set and a wrong oldPassword.
  3. Read the account back from the multiaccounts DB.

Observed (develop bd4201f95):
the call returns an error, keystore files are intact, the keypair
is not migrated — but GetAccount(keyUID).KeycardPairing holds the new pairing value.

Suggested:
write the pairing after validation, or roll it back on failure.

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