requiresFallbackGas
cannot guarantee adequate gas for anyFallback
#311
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-183
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#L1061-L1072
https://github.com/code-423n4/2023-05-maia/blob/54a45beb1428d85999da3f721f923cbf36ee3d35/src/ulysses-omnichain/BranchBridgeAgent.sol#L1410-L1412
Vulnerability details
Impact
requiresFallbackGas
cannot guarantee adequate gas foranyFallback
. If fallback execution_forceRevert()
, the user can no longerredeemDeposit
and their asset will be permanently lost.Proof of Concept
There are two possibilities that deposited gas would be insufficient for fallback execution:
msg.value
is only slightly larger thantx.gasprice * MIN_FALLBACK_RESERVE
but smaller thantx.gasprice * (MIN_FALLBACK_RESERVE + _initialGas - gasLeft)
tx.gasprice
rises during two transactions.Tools Used
Manual review
Recommended Mitigation Steps
Charge and replenish fallback gas during the initial deposit call and never
forceRevert()
fallback execution (consequence is severe).Assessed type
Context
The text was updated successfully, but these errors were encountered: