Open code423n4 opened 3 years ago
Not a bug, distributeToHolders
and withdrawFundsOnBehalfOf
will always be called atomically by the governor.
Without code to ensure that withdrawFundsOnBehalfOf is called immediately after
distributeToHolders`, this bug can still occur. I'm considering this Likelihood=Low,Impact=Medium => Severity=Low.
Handle
@cmichelio
Vulnerability details
Vulnerability Details
Anyone can send the USDC interest to the balancer pool by calling
withdrawFundsOnBehalf(balancerPool)
.An attacker can abuse this to capture part of this interest by doing the following steps in a single transaction:
withdrawFundsOnBehalf(bPool)
, callgulp
.Impact
USDC interest that was supposed to go to MPT balancer pool stakers is stolen by attackers. Funds might be locked forever.
Recommended Mitigation Steps
This is hard to prevent completely because you're sending free money to the pool. One way to reduce the risk is to only allow claiming interest by the governor / trusted parties. This would disallow attacker to perform this in a risk-free way in a single transaction, but the same attack would still be possible for miners.
Consider alternative ways of distributing the interest of balancer pools like transferring it to all MPT holders instead of liquidity providers, because:
withdrawFundsOnBehalf
was called will benefit, regardless of how long they have been providing this liquidity.