Submitted by Fassi_Security, also found by max10afternoon, 0xJoyBoy03, and web3pwn
The Sponsors noted via discord communication:
This is important to mention because this issue would not be significant if the minimum time between reward distribution was, for example, 100 blocks; and since there is a mempool, front-running is possible.
The project holds liquid NFTs, which accumulate rewards. These rewards are used to reward the erc20 token holders.
These rewards are transferred to the liquiderc20 contract by using the two following functions:
However, the problem here is the following check inside withdrawFromManagedNFTs:
Even when there are 0 rewards in the current contract, a malicious user can still call distribute(1) to start the distribution process and to set the LockedForDistribution boolean to true.
This results in no one being able to call withdrawFromManagedNFTs to get the rewards inside the erc20 contract to distribute, which results in the next reward cycle being after block.number + MinDistributionPeriod.
There are roughly 7000 blocks per day, so we will use (7000 * 30) = 210000 blocks to mock a distribution period of roughly 1 month.
We have written a Proof of Concept using Foundry, please follow the instructions provided and read the comments in the PoC for documentation.
As you can see by running our PoC, a whole month of rewards is unable to be claimed by approved holders due to any person calling the distribute function; even if there are 0 rewards currently able to be distributed to the approved holders. For a project that is built upon rewarding its holders at a fixed period of time, this breaks the core functionality of the project.
Foundry
Do not start a distribution cycle if there are no rewards that can be paid out to the approved holders and keep track of the rewards currently held in the liquidNFT. Only start reward cycles when this amount that is held in the liquidNFT is sent to the liquidERC20. This prevents malicious users from sending 1 wei of rewardTokens to the liquidERC20 to maliciously start a distribution cycle.
ChristianBorst (Althea) acknowledged and commented via duplicate issue #594:
0xA5DF (judge) commented via duplicate issue #594:
0xA5DF (judge) decreased severity to Medium and commented:
bronze_pickaxe (warden) commented:
0xA5DF (judge) commented:
