Closed c4-bot-5 closed 6 months ago
raymondfam marked the issue as sufficient quality report
raymondfam marked the issue as primary issue
Will let sponsor review the coded POC and its validity.
ditto-eth marked the issue as disagree with severity
ditto-eth (sponsor) disputed
ditto-eth marked the issue as agree with severity
This is intentional, the bridge credit system is overly conservative in protecting against arbitrage. The bridge credit system is not only a "reward" for fee-free withdrawals but also a restriction to protect bridge makeup: https://dittoeth.com/technical/arbitrage#credit-system
hansfriese marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2024-03-dittoeth/blob/91faf46078bb6fe8ce9f55bcb717e5d2d302d22e/contracts/facets/BridgeRouterFacet.sol#L101
Vulnerability details
Impact
The liquidator will receive
ETH
when the liquidation is successful inPrimaryLiquidationFacet#L220
orPrimaryLiquidationFacet#L223
. Similarly, when a redemption can be claimed, the redeemer will also receiveETH
(RedemptionFacet#L331
).The issue arises when the user, whether a liquidator or redeemer, incurs fees when withdrawing the
ETH
. This occurs because inBridgeRouterFacet
, if there is insufficient credit, fees are charged (BridgeRouterFacet#L109-L116
).The liquidator will end up paying fees based on the withdrawal amount and the bridge the liquidator intends to use, which may affect the final amount of ETH received. In some cases, it might not be convenient for the liquidator to pay those fees if the received collateral was minimal.
Proof of Concept
Consider the following scenario:
UserA
is solely a liquidator and has noETH
deposited in any bridge, resulting inethEscrowed=0
,bridgeCreditReth=0
, andbridgeCreditSteth=0
.UserA
receivesETH
through successful liquidations, increasing theirethEscrowed
.UserA
decides to withdraw theETH
; however, since he has no credit inbridgeCreditReth
orbridgeCreditSteth
, they will be charged a fee.Tools used
Manual review
Recommended Mitigation Steps
Liquidators should be able to withdraw
ETH
without incurring fees. It's necessary to consider transferring thebridgeCredit
from the liquidated user to the liquidator, and the same applies to redemptions.Assessed type
Context