Submitted by cmichel, also found by leastwood
The GovernorAlpha inherits from a vulnerable TimelockController.
This TimelockController allows an EXECUTOR role to escalate privileges and also gain the proposer role. See details on OZ and the fix here.
The bug is that _executeBatch checks if the proposal was scheduled only after the transactions have been executed. This allows inserting a call into the batch that schedules the batch itself, and the entire batch will succeed.
As the custom GovernorAlpha.executeProposal function removed the original queued state check (require(state(proposalId) == ProposalState.Queued), the attack can be executed by anyone, even without the EXEUCTOR_ROLE.
Proof of concept:
The impact is that, anyone who can create a proposal can become Timelock admin (proposer & executor) and execute arbitrary transactions as the DAO-controlled GovernorAlpha.
Note that this contract has severe privileges and an attacker can now do anything that previously required approval of the DAO. For example, they could update the globalTransferOperator and steal all tokens.
Recommend updating the vulnerable contract to TimelockController v3.4.2 as it currently uses OpenZeppelin/openzeppelin-contracts@3.4.0-solc-0.7
jeffywu (Notional) confirmed
