Submitted by panprog, also found by 0xsanson, bin2chen, hansfriese, kenzo, PwnedNoMore, smiling_heretic, Treasure-Seeker, and TrungOre
If one proposal starts a buyout which fails, and then another proposal starts a buyout which succeeds, then both of them will be commited and settleVault can be called on any of them. If its called on the failed proposal first, then it will settle even though buyout has failed (and it can proceed to withdraw all tokens to a new vault).
Malicious proposal being able to successfully migrate scenario:
Add this code to test/Migration.t.sol
Add a new storage variable for currently active proposal id. Allow calling settleVault only for active proposal id (and also only if buyouts proposer equals Migration address, otherwise there can be a different successful buyout not connected to the active proposal). Also add appropriate checks with active proposal in the other functions as well (dont allow to commit if there is an active proposal etc).
Ferret-san (Fractional) confirmed
HardlyDifficult (judge) commented:
