Submitted by berndartmueller, also found by ciphermarco
BTC transactions originating from the TSS address can be griefed by an attacker, preventing the TSS address from sending BTC transactions.
The Bitcoin client retrieves all UTXOs for the TSS address with the FetchUTXOS function. Subsequently, the UTXOs are used as inputs for outgoing cctxs to cover the expenses of the transaction.
Concretely, the UTXOs are queried from the RPC by calling the ListUnspentMinMaxAddresses function in line 737. However, the first argument, the minimum number of confirmations, is set to 0.
As a result, the UTXOs returned by the RPC call include unconfirmed UTXOs, i.e., transaction outputs that are not yet confirmed by subsequent blocks.
Consequently, an attacker can craft a BTC transaction to the TSS address, with a low fee, and broadcast it to the network (the transaction outputs must match the range of UTXOs that will be used by the TSS address for the next transaction). While the transaction and its outputs are sitting unconfirmed in the mempool, the observer Bitcoin clients will retrieve these unconfirmed outputs as UTXOs.
The unconfirmed UTXOs are then used as inputs for outgoing TSS BTC transactions, which will also remain unconfirmed as long as the original transaction (from the attacker) remains unconfirmed. This can cause a halt in the outgoing BTC transactions from the TSS address.
Moreover, the attacker can replace the original transaction via the Replace-by-fee (RBF) policy, and change the recipient address to an address other than the TSS address. This will render the UTXOs used as inputs for the TSSs outgoing transaction invalid, causing the outgoing transaction to fail.
Comparing ZetaChains UTXO retrieval mechanism with Thorchains implementation, the latter treats unconfirmed UTXOs separately by checking if the UTXO was self-sent or sent from the Asgard address:
bifrost/pkg/chainclients/bitcoin/client.go#L274-279
Client.isSelfTransaction
Consider only using unconfirmed UTXOs as inputs for outgoing transactions if the UTXOs were sent from the TSS address, similar to Thorchains implementation.
lumtis (ZetaChain) confirmed
