PSBT: Old password prompt can send a newly imported transaction #1037

Closed
opened 2026-10-15 07:15:58 +00:00 by jarolrod · 0 comments
jarolrod commented 2026-10-15 07:15:58 +00:00 (Migrated from github.com)

I can import another PSBT while the first one's password prompt is open, then use that old prompt to sign and broadcast the replacement. The wallet never changes.

Tested on qt6 at d567e3eb2497, native macOS / Qt 6.9.0, with a disposable regtest wallet.

  1. Use an encrypted, locked wallet with a confirmed spendable coin large enough for both test payments.
  2. Use walletcreatefundedpsbt with psbt_version=0 to make two unsigned PSBTs spending the same coin: one sending 0.1 BTC and another sending 0.2 BTC to a valid regtest address. Base64-decode each returned psbt field and save it as a binary .psbt file.
  3. Import the 0.1 BTC file through File → Load PSBT from file, click Send transaction, and leave the password prompt open.
  4. Use File → Load PSBT from file again and import the 0.2 BTC file.
  5. Enter the password in the surviving prompt and click Unlock and send. Don't click Send transaction again for the replacement.

The review updates to 0.2 BTC behind the prompt, but the old prompt stays active and sends that replacement. I checked the exact transaction ID in the mempool: the second PSBT was broadcast, the first wasn't. Without the replacement import, the normal signing flow sent the expected transaction.

onTransactionChanged only closes the sweep warning. The password handler still calls sendTransactionWithPassphrase() against the wallet's current transaction.

Importing a new PSBT should close and invalidate the old signing prompt. A stale submission also needs to be rejected before signing, so the replacement gets a fresh review and Send decision.

Related to #1027, #975 and #762. #1027 covers this prompt getting stuck after unloading its wallet; this case happens within the same wallet and broadcasts the replacement.

I can import another PSBT while the first one's password prompt is open, then use that old prompt to sign and broadcast the replacement. The wallet never changes. Tested on `qt6` at `d567e3eb2497`, native macOS / Qt 6.9.0, with a disposable regtest wallet. 1. Use an encrypted, locked wallet with a confirmed spendable coin large enough for both test payments. 2. Use `walletcreatefundedpsbt` with `psbt_version=0` to make two unsigned PSBTs spending the same coin: one sending 0.1 BTC and another sending 0.2 BTC to a valid regtest address. Base64-decode each returned `psbt` field and save it as a binary `.psbt` file. 3. Import the 0.1 BTC file through File → Load PSBT from file, click Send transaction, and leave the password prompt open. 4. Use File → Load PSBT from file again and import the 0.2 BTC file. 5. Enter the password in the surviving prompt and click Unlock and send. Don't click Send transaction again for the replacement. The review updates to 0.2 BTC behind the prompt, but the old prompt stays active and sends that replacement. I checked the exact transaction ID in the mempool: the second PSBT was broadcast, the first wasn't. Without the replacement import, the normal signing flow sent the expected transaction. `onTransactionChanged` only closes the sweep warning. The password handler still calls `sendTransactionWithPassphrase()` against the wallet's current transaction. Importing a new PSBT should close and invalidate the old signing prompt. A stale submission also needs to be rejected before signing, so the replacement gets a fresh review and Send decision. Related to #1027, #975 and #762. #1027 covers this prompt getting stuck after unloading its wallet; this case happens within the same wallet and broadcasts the replacement.
Sign in to join this conversation.
No description provided.