batchTransferOutV5
could emit multiple TransferOut
events, but Bifrost Observation can handle only one per transaction.
#7
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
🤖_19_group
AI based duplicate group recommendation
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2024-06-thorchain/blob/e5ae503d0dc2394a82242be6860eb538345152a1/ethereum/contracts/THORChain_Router.sol#L247-L253
https://github.com/code-423n4/2024-06-thorchain/blob/e5ae503d0dc2394a82242be6860eb538345152a1/ethereum/contracts/THORChain_Router.sol#L209-L238
https://github.com/code-423n4/2024-06-thorchain/blob/e5ae503d0dc2394a82242be6860eb538345152a1/bifrost/pkg/chainclients/shared/evm/smartcontract_log_parser.go#L166-L343
Vulnerability details
Impact
The
batchTransferOutV5
function is the batch version of thetransferOutV5
function. When provided with an array ofTransferOutData
, thebatchTransferOutV5
function can emit multipleTransferOut
events in one transaction.However, in the
GetTxInItem
function insmartcontract_log_parser.go
, if there are multipletransferOutEvent
s in thelogs
array, the information intxInItem
is overwritten during the iteration of the lasttransferOutEvent
. Consequently, only the lasttransferOutEvent
is logged by Bifrost (itstxInItem
populated byGetTxInItem
), and all previous ones are ignored.As a result, when a THORChain vault uses
batchTransferOutV5
, their allowance could be spent without the THORChain network acknowledging the outbound from the vault, leading to a loss of funds for the THORChain vault.Tools Used
Manual Review
Recommended Mitigation Steps
Modify the event logging logic in
smartcontract_log_parser.go
to accommodate the use ofbatchTransferOutV5
.Assessed type
Error
The text was updated successfully, but these errors were encountered: