Submitted by rayn
AxelarGatewayMultisig.sol#L484
AxelarGatewayMultisig.sol#L490
AxelarGatewayMultisig.sol#L529
Since this is important, we quote it again instead of referring to our other bug report on a different, yet related bug. The context within which a command is executed is extremely important.
Thus if an attacker manages to rearrange execution order of commands within a batch, it should probably be treated seriously. This is exactly what might happen here due to reentrancy. A malicious player that managed to gain reentrancy over execute can easily execute later commands in a batch before earlier commands are fully executed, effectively breaking all assumptions on command executed context.
The _execute function and its wrapper execute are both reentrant.
Thus if an attacker manages to reenter the _execute function with the same batch of commands and signatures, previously successfully executed and ongoing commands will be skipped due to premature marking of the success flag.
This allows later commands to be executed before the current ongoing command is finished. The reentrant attack can be nested to perform further reordering of commands.
Generally speaking, other unrelated batches of signed commands can only be executed, but since the assumption of ordering is most likely stronger within a single batch, we focus on illustrating the single batch scenario above.
vim, ganache-cli
Make execute nonReentrant
Add an ever increasing nonce to signatures to prevent replay
deluca-mike (Axelar) acknowledged, but disagreed with High severity and commented:
0xean (judge) decreased severity to Medium and commented:
