Users can use updateBoost function to claim unfairly large rewards from liquidity mining contracts for themselves at cost of other users.
The updateBoost function allows a user to change their boost multiplier without first claiming rewards, so they can apply a higher multiplier to past stakes and claim more than their fair share. An attacker could steal liquidity mining rewards from honest users by calling updateBoost before repaying or claiming.
Submitted by smilingheretic, also found by unforgiven_
Users aware of this vulnerability could effectively steal a portion of liquidity mining rewards from honest users.
Affected contracts are: SupplyMinerV2, DemandMinerV2, PARMinerV2
VotingMinerV2 is less affected because locking veMIMO in votingEscrow triggers a call to releaseMIMO of this miner contract (which in turn updates user’s boost multiplier).
Proof of Concept
Let’s focus here on SupplyMinerV2. The exploits for other liquidity mining contracts are analogous.
Scenario 1:
Both Alice and Bob deposit 1 WETH to coreVaults and borrow 100 PAR from coreVaults. They both have no locked veMIMO.
Now they wait for a month without interacting with the protocol. In the meantime, SupplyMinerV2 accumulated 100 MIMO for rewards.
Alice locks huge amount of veMIMO in votingEscrow, so now her boostMultiplier is 4.
Let’s assume that Alice and Bob are the only users of the protocol. Because they borrowed the same amounts of PAR, they should have the same stakes for past month, so a fair reward for each of them (for this past month) should be 50 MIMO. If they simply repay their debts now, 50 MIMO is indeed what they get.
However if Alice calls supplyMiner.updateBoost(alice) before repaying her debt, she can claim 80 MIMO and leave only 20 MIMO for Bob. She can basically apply the multiplier 4 to her past stake.
Scenario 2:
Both Alice and Bob deposit 1 WETH to coreVaults and borrow 100 PAR from coreVaults. Bob locks huge amount of veMIMO in votingEscrow for 4 years, so now his boostMultiplier is 4.
Alice and Bob wait for 4 years without interacting with the protocol.
SupplyMinerV2 accumulated 1000 MIMO rewards.
Because of his locked veMIMO, Bob should be able to claim larger reward than Alice. Maybe not 4 times larger but definitely larger.
However, if Alice includes a transaction with call supplyMiner.updateBoost(bob) before Bob’s vaultsCore.repay() , then she can claim 500 MIMO. She can effectively set Bob’s boostMultiplier for past 4 years to 1.
Tools Used
Tested in Foundry
Recommended Mitigation Steps
I have 2 ideas:
- Remove
updateBoostfunction. There shouldn’t be a way to update boost multiplier without claiming rewards and updating_userInfo.accAmountPerShare. SoreleaseRewardsshould be sufficient. - A better, but also much more difficult solution, would be to redesign boost updates in such a way that distribution of rewards no longer depends on when and how often boost multiplier is updated. If the formula for boost multiplier stays the same, this approach might require calculating integrals of the multiplier as a function of time.
m19 (Mimo DeFi) confirmed and commented:
We agree this is an issue and intend to fix it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the updateBoost function updates the boost multiplier without first settling and claiming rewards, so the new multiplier is applied retroactively to past stakes.
What the attacker needed
A user position in the liquidity mining contract; ability to lock veMIMO to change boost multiplier; no interaction with the protocol during the reward period
The fix
The updateBoost function should be removed so boost multipliers can only change when rewards are claimed and user accounting is updated.
How it was found
- Alice and Bob deposit and borrow equal amounts, then wait without interacting.
- Rewards accumulate in the miner contract.
- Alice locks a large amount of veMIMO to raise her boost multiplier.
- Alice calls updateBoost on herself before repaying, then claims a larger share of past rewards.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Liquidity mining rewards are shared based on how much each person staked over time. A boost multiplier increases your share. The bug lets someone increase their multiplier and have it apply to past time, so they take more rewards than they earned, leaving less for others.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.