Submitted by klau5, also found by falconhoof, Toshii, jasonxiale, 0xCiphky, 0xbepresent (1, 2), jesjupyter, KingNFT, pkqs90, Topmark, 0xAsen, and nonseodion
https://github.com/code-423n4/2024-01-salty/blob/aab6bbc6fe49d4dd37becc7bbd0c847ec4a7c1e6/src/dao/DAO.sol#L157-L164 
https://github.com/code-423n4/2024-01-salty/blob/aab6bbc6fe49d4dd37becc7bbd0c847ec4a7c1e6/src/pools/PoolStats.sol#L51-L55
When a pool that has been excluded from the whitelist is added again, it can receive liquidity rewards based on the previous _arbitrageProfits.
When unwhitelisting, _arbitrageProfits is not cleared. When added to the whitelist again, rewards can be distributed unfairly due to the remaining _arbitrageProfits.
Lets assume there are A/WETH, A/WBTC, B/WETH, B/WBTC, WETH/WBTC pools. A swap occurred in each of the A/WETH, B/WETH pools, generating 1 ether of arbitrage profit. If the liquidity rewards are settled at this time, each pool can receive liquidity rewards at a ratio of A/WETH: A/WBTC: B/WETH: B/WBTC: WETH/WBTC = 1: 1: 1: 1: 2. This is because they can take as much as the proportion of profits generated in each pool.
Suppose you unwhitelist B tokens without settling rewards. The B/WETH and B/WBTC pools will be unwhitelisted. Since they are not included in the whitelist, they cannot be involved in reward settlements, so even if the someone calls performUpkeep , their _arbitrageProfits remain the same.
Time has passed and B token is added to the whitelist again, so that the B/WETH, B/WBTC pools are registered on the whitelist. Since the past _arbitrageProfits were not cleared, 1 ether remains in B/WETH pools _arbitrageProfits. The rewards for the other pools have already been settled and _arbitrageProfits has been reset.
After that, the A/WBTC pool makes new arbitrage profit of 0.1 ether. If the reward is settled in this state, they will receive rewards at a ratio of A/WETH: A/WBTC: B/WETH: B/WBTC: WETH/WBTC = 1: 1: 10: 10: 11.
This is the PoC. You can add it to the DAO.t.sol file and test it.
Before finalizing the unwhitelist ballot, user should call performUpkeep first to force the rewards to be settled. Check if _arbitrageProfits is cleared.
othernet-global (Salty.IO) disputed and commented:
