Closed code423n4 closed 1 year ago
trust1995 marked the issue as primary issue
trust1995 marked the issue as satisfactory
0xBugsy marked the issue as sponsor confirmed
trust1995 marked issue #679 as primary and marked this issue as a duplicate of 679
Lines of code
https://github.com/code-423n4/2023-05-maia/blob/main/src/ulysses-omnichain/RootBridgeAgent.sol#L1219 https://github.com/code-423n4/2023-05-maia/blob/main/src/ulysses-omnichain/RootBridgeAgent.sol#L850
Vulnerability details
Impact
RootBridgeAgent.sol#depositGasAnycallConfig
can be use to topup gas to contract. https://github.com/code-423n4/2023-05-maia/blob/main/src/ulysses-omnichain/RootBridgeAgent.sol#L1219but due to how
_replenishGas
is implemented inrootBridgeAgent.sol
. https://github.com/code-423n4/2023-05-maia/blob/main/src/ulysses-omnichain/RootBridgeAgent.sol#L850it wrongly withdraw from
WrappedNativeToken
before deposit, but this value is sent directly following the call todepositGasAnycallConfig
and shouldn't be unwrapped first. The unwrapped eth would be unaccounted for and remains within the contract.Proof of Concept
https://github.com/code-423n4/2023-05-maia/blob/main/src/ulysses-omnichain/RootBridgeAgent.sol#L1219 https://github.com/code-423n4/2023-05-maia/blob/main/src/ulysses-omnichain/RootBridgeAgent.sol#L850
Tools Used
Manuel Review
Recommended Mitigation Steps
depositGasAnycallConfig
should not withdraw from WrappedNativeToken, you can implement_replenishGas
as in BranchBridgeAgent.sol and unwrap tokens seperately before calling_replenishGas
.Assessed type
Context