Submitted by PwnedNoMore, also found by ak1, CertoraInc, and scaraven
https://github.com/code-423n4/2022-08-fiatdao/blob/fece3bdb79ccacb501099c24b60312cd0b2e4bb2/contracts/VotingEscrow.sol#L509-L515
In the VotingEscrow contract, users can increase their voting power by:
Specifically, when users are delegated by other users through the delegate function, the delegated user gains control over the delegate funds from the delegating user.
The delegated user can further increase this power by increasing the time that the delegated funds are locked by calling increaseUnlockTime, resulting in ALL the delegated funds controlled by the delegated user, including those that do not originate from the delegated user, being used to increase the voting power of the user.
The issue lies in the following scenario: If user A delegates to user B, and then user B delegates to user C, user B loses the ability to extend his or her voting power by increaseUnlockTime due to a missing _checkpoint operation. If user B calls the increaseUnlockTime function, the _checkpoint operation will not proceed, as user B is delegating to user C. However, B still owns delegated funds, in the form of the funds delegated from user A. Therefore, user B should still gain voting power from increaseUnlockTime, even though user B is delegating.
Assume three users, Alice, Bob, and Carol, who each possess locks with 10 units of delegate value. Also assume that the unlock time is 1 week.
Move the _checkpoint outside of the if statement on line 514.
lacoop6tu (FIAT DAO) confirmed, but disagreed with severity and commented:
Justin Goro (judge) decreased severity to Medium
IllIllI (warden) reviewed mitigation:
