mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:54:42 +00:00
Import PSBT accepts structurally invalid transactions into review and signing #1070
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml#1070
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Import PSBT does not reject some invalid transaction structures before building the review. In the duplicate-input case, the flow also signs and commits an invalid wallet transaction, reports completion, and leaves the original coin unavailable until the transaction is abandoned.
A separate malformed-output case produces incorrect review totals. Both belong to the checks needed before an imported transaction becomes a payment review.
Duplicate-input reproduction
QML reports completion, but the node rejects the transaction with
bad-txns-inputs-duplicate. The wallet nevertheless retains the invalid send record, and the original outpoint is no longer available throughlistunspent.Calling
abandontransactionon that record restores the coin’s availability. The transaction was never accepted into the mempool; no permanent fund loss was demonstrated.Malformed-output reproduction
Import PSBTs with these raw output amounts, in satoshis:
[INT64_MAX, INT64_MAX, 4]: the review reports an aggregate of 2 sats.[INT64_MIN, INT64_MAX, 2]: the review accepts the negative and out-of-range outputs and reports 1 sat.The individual recipient rows retain the malformed values. In these fixtures, missing input information makes the fee unknown, so Send and Broadcast remain disabled.
Expected behavior and responsibility
Reject duplicate inputs, invalid output amounts, and invalid aggregate totals before constructing an actionable review. Duplicate-input transactions must not reach signing or wallet commit.
This crosses the QML/Core wallet boundary: the shared PSBT analysis and wallet signing/commit path allow the duplicate-input transaction to progress, while QML uses those results to approve and complete the flow. QML’s wallet and recipient models also aggregate malformed output amounts without the necessary range and overflow checks. Core’s node validation correctly rejects the invalid transaction.
This complements #1008: correcting the completion message alone would still leave the invalid wallet record and unavailable coin.
Reproduced on
qt6atd567e3eb2497, macOS arm64, Qt 6.9.0, using disposable regtest fixtures.