Submitted by klau5, also found by 0xlemon, 0xpiken, and shaflow2
https://github.com/code-423n4/2024-12-bakerfi/blob/0daf8a0547b6245faed5b6cd3f5daf44d2ea7c9a/contracts/core/strategies/StrategySupplyBase.sol#L90
Since StrategySupplyBase.harvest can be called by anyone, users can front-run the rebalance call or regularly call harvest to avoid paying protocol fees on interest. This allows users to receive more interest than they should.
When there are profits in the Strategy, the administrator calls rebalance to settle protocol fees(performance fee). This calls Strategy.harvest to update the total deployed asset amount including interest and returns the amount of newly generated interest. Then n% of the interest is taken as protocol fees.
However, StrategySupplyBase.harvest can be called by anyone. By front-running the rebalance request or regularly calling this function, users can avoid paying protocol fees on interest. This allows users to receive more interest than they should.
This is PoC. It demonstrates that anyone can call StrategySupplyBase.harvest. This can be run by adding it to the StrategySupplyAAVEv3.ts file.
Add the onlyOwner modifier to StrategySupplyBase.harvest to restrict access.
chefkenji (BakerFi) confirmed
BakerFi mitigated:
Status: Mitigation confirmed. Full details in reports from 0xlemon and shaflow2.
