Submitted by kyliek, also found by Ruhum and WatchPug
LiquidityPool.sol#L149-L173
LiquidityPool.sol#L263-L277
depositErc20 allows an attacker to specify the destination chain to be the same as the source chain and the receiver account to be the same as the caller account. This enables an attacker to drain the incentive pool without rebalancing the pool back to the equilibrium state.
This requires the attacker to have some collateral, to begin with. The profit also depends on how much the attacker has. Assume the attacker has enough assets.
In each chain, when the pool is very deficit (e.g. currentLiquidity is much less than providedLiquidity), which often mean theres a good amount in the Incentive pool after some high valued transfers, then do the following.
The executor will call sendFundsToUser to msg.sender. Then a rewardAmount, equivalent to the entire incentive pool (up to 10% of the total pool value), will be added to msg.sender minus equilibrium fee (~0.01%) and gas fee.
In the end, the pool is back to the deficit state as before, the incentive pool is drained and the exploiter pockets the difference of rewardAmount minus fees.
This attack can be repeated on each deployed chain multiple times whenever the incentive pool is profitable (particularly right after a big transfer).
tomarsachin2271 (Biconomy) commented:
ankurdubey521 (Biconomy) confirmed and commented:
pauliax (judge) decreased severity to Medium and commented:
