Closed code423n4 closed 1 year ago
trust1995 marked the issue as primary issue
trust1995 marked the issue as satisfactory
trust1995 changed the severity to 2 (Med Risk)
0xBugsy marked the issue as sponsor confirmed
trust1995 changed the severity to 3 (High Risk)
trust1995 marked the issue as selected for report
trust1995 marked the issue as not selected for report
trust1995 marked the issue as duplicate of #645
Lines of code
https://github.com/code-423n4/2023-05-maia/blob/54a45beb1428d85999da3f721f923cbf36ee3d35/src/ulysses-omnichain/RootBridgeAgent.sol#L759
Vulnerability details
Impact
Excess gas fee is accumulated within root bridge agent as WETH. Attacker can
retrySettlement
by virtual account to steal the accumulated fee.Proof of Concept
Steps:
callOutSigned
with zero_remoteExecutionGas
and non-arbtoChain
.callOutSigned
with nonzero_remoteExecutionGas
.retrySettlement
with a failed nonce.initialGas
will be greater than zero anduserFeeInfo.gasToBridgeOut
amount of WETH will be swapped into remote chain gas token._payExecutionGas
at branch chain.Note: It's better to attack with a larger
_remoteExecutionGas
so that less gas will be wasted by multiple executions.Tools Used
Manual
Recommended Mitigation Steps
availableGas
at the beginning ofanyExecute
:userFeeInfo.gasToBridgeOut
after_manageGasOut
.availableGas
as input for_payExecutionGas
.Assessed type
Reentrancy