BranchBridgeAgent invokes anyCall with PAY ON SOURCE but doesn't send value with it. All calls will fail. #860
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-91
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/code-423n4/2023-05-maia/blob/54a45beb1428d85999da3f721f923cbf36ee3d35/src/ulysses-omnichain/BranchBridgeAgent.sol#L1006-L1011
https://github.com/code-423n4/2023-05-maia/blob/54a45beb1428d85999da3f721f923cbf36ee3d35/src/ulysses-omnichain/lib/AnycallFlags.sol#L11
Vulnerability details
Impact
IAnycallProxy().anyCall()
operates under one of two modes of taking fees, namely fees are taken either on source or on the destination chain. Fee mode is decided by the caller with an appropriate value of the fourth parameter, ie.uint256 _flag
. Values 0,4 denote the SOURCE chain. Such invocation requireether
to be send along (IAnycallProxy().anyCall()
is payable) and in case of insufficient value being sent will fail.BranchBridgeAgent._performCall()
invokesanyCall()
withAnycallFlags.FLAG_ALLOW_FALLBACK
which is defined as0x1 << 2
ie4
source:
BranchBridgeAgent.sol
source:
AnycallFlags.sol
Consequently all cross bridge requests will fail.
Tools Used
Manual review, Multichain documentation: (Link to
anyCall
flags definition)[https://docs.multichain.org/developer-guide/anycall-v7/quickstart-cross-chain-text-example]Recommended Mitigation Steps
Judging from the
RootBridgeAgent.anyExecute()
implementation the intended mode is to pay fees on the destination chain (with fallback enabled). Under this assumption_flag = 6
should be passed ie.AnycallFlags.FLAG_ALLOW_FALLBACK_DST
Assessed type
Other
The text was updated successfully, but these errors were encountered: