Closed c4-bot-1 closed 4 months ago
I believe this is an issue and should be fixed
trust1995 marked the issue as satisfactory
trust1995 marked the issue as selected for report
This may result in multiple TransferAllowance events being included and processed within a single transaction. This breaks the expectation that only one TransferAllowance event is processed per transaction, and may result in unaccounted for or unexpected asset transfer or churning between more than one vault per transaction.
@the-eridanus can you confirm how these unwanted impacts could occur due to the bug outlined?
This may result in multiple TransferAllowance events being included and processed within a single transaction. This breaks the expectation that only one TransferAllowance event is processed per transaction, and may result in unaccounted for or unexpected asset transfer or churning between more than one vault per transaction.
@the-eridanus can you confirm how these unwanted impacts could occur due to the bug outlined?
Reviewing this one again, I think this can be categorized as low
severity. The only way this could be an issue is if somehow the bifrost code was updated unintentionally to sign multiple transferAllowance events in one tx, which is not likely.
trust1995 changed the severity to QA (Quality Assurance)
trust1995 marked the issue as grade-c
Lines of code
https://github.com/code-423n4/2024-06-thorchain/blob/e3fd3c75ff994dce50d6eb66eb290d467bd494f5/bifrost/pkg/chainclients/shared/evm/smartcontract_log_parser.go#L244
Vulnerability details
Impact
The
transferAllowanceEvent
case insmartcontract_log_parser:GetTxInItem
does not set theearlyExit
flag totrue
, which is required to terminate the log parsing process if more than one of a particular event is included in a transaction.Only one
TransferAllowance
event is expected to be emitted per transaction, as is also the case for theTransferOut
event. The transferOutEvent case insmartcontract_log_parser:GetTxInItem
sets theearlyExit
flag totrue
to prevent additionalTransferOut
events from being included in the transaction block, however this flag is not set in the transferAllowanceEvent case.This may result in multiple
TransferAllowance
events being included and processed within a single transaction. This breaks the expectation that only oneTransferAllowance
event is processed per transaction, and may result in unaccounted for or unexpected asset transfer or churning between more than one vault per transaction.Tools Used
VS Code
Recommended Mitigation Steps
Set
earlyExit = true
at the end of thetransferAllowanceEvent
case ofsmartcontract_log_parser:GetTxInItem
:Assessed type
Other