Submitted by ronnyx2017, also found by immeas and GalloDaSballo
https://github.com/Tapioca-DAO/tap-token/blob/20a83b1d2d5577653610a6c3879dff9df4968345/contracts/governance/twTAP.sol#L592-L594
The function twTAP._releaseTap updates only --twAML.totalParticipants and neglected to update twAML.averageMagnitude. This will result in twAML.averageMagnitude accumulating every time a new position participates, without ever decreasing.
An attacker can monopolize the gov by precisely controlling the number of tokens entering and exiting to ensure that only their own position remains in the current twTap.
On the other hand, there is another exploit way here. If pool.cumulative < pool.averageMagnitude, then pool.cumulative will be set to 0. But the greater position.averageMagnitude will be added to pool.cumulative when the position exits. This will cause pool.cumulative to continuously increase,  which will result in the efficiency of twTAP/TapiocaOptionBroker becoming increasingly lower. Because the multiplier of the twTAP or target of the TapiocaOptionBroker will always be dMIN.
The same issue is also in the TapiocaOptionBroker. The only difference is that the pool.cumulative cant be decreased to zero, because it will be reset to EPOCH_DURATION if its zero here. The following PoC uses the twTap as the exploit case.
We describe this attack using the simplest scenario, assuming that initially, the pool contains only the attackers own position, but the pool.averageMagnitude is not zero (which means there were some participators before).
https://github.com/Tapioca-DAO/tap-token/blob/20a83b1d2d5577653610a6c3879dff9df4968345/contracts/governance/twTAP.sol#L331-L336
Now others will no longer be able to participate in twTAP, and the gov will be monopolized by the attacker.
Please note that the pool contains only the attackers own position is not a necessary condition; the attack can still be carried out even with the participation of others. As the exit process accumulates, this attack will become increasingly easier to occur, and may even be triggered unintentionally by users.
Update pool.averageMagnitude in the _releaseTap.
Context
LSDan (judge) decreased severity to Medium
0xRektora (Tapioca) confirmed, but disagreed with severity and commented via duplicate Issue #165:
Note: For full discussion, see here.
