Submitted by kennedy1030, also found by deepplus and KupiaSec
https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/automators/AutoExit.sol#L100-L214
https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/automators/Automator.sol#L193-L215
The owner of the NFT could end up paying more rewards to AutoExit than anticipated when onlyFee is set to true.
https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/automators/AutoExit.sol#L155
https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/automators/Automator.sol#L208
As seen at L208, feeAmount represents the uncollected fees excluding assets from the current liquidity. However, it includes the owed amount, which comprises uncollected assets not just from fees but also from nonfungiblePositionManager.decreaseLiquidity() called earlier at L202. If the owner has already executed nonfungiblePositionManager.decreaseLiquidity(), the uncollected assets would consist of some assets withdrawn from their liquidity, possibly a significant portion. This implies that onlyFee configuration is not functioning effectively.
Here is a simple scenario to highlight this issue:
In Automator._decreaseFullLiquidityAndCollect(), feeAmount0, feeAmount1 must only include the amount calculated from the feeGrowthInside of UniswapV3 position.
mariorz (Revert) acknowledged, but disagreed with severity and commented:
ronnyx2017 (judge) decreased severity to Medium and commented:
