User cannot vote for the proposal with same proposalId after Instruction module is updated.
Proof of Concept
If Alice voted for proposal 10 and her vote is greater than 0, userVotesForProposal[10][Alice] > 0 and it is not reset to zero if she reclaims the vote.
After that, if the instruction module is updated, the proposal id starts from 1.
And Alice can not vote for proposal 10 because userVotesForProposal[10][Alice] is positive.
Tools Used
Manual Review
Recommended Mitigation Steps
Add userVotesForProposal[proposalId_][msg.sender] = 0 to Governance.reclaimVotes.
Lines of code
https://github.com/code-423n4/2022-08-olympus/blob/70d7259581fe32647293ca4ff653ca3f2ad770b6/src/policies/Governance.sol#L247 https://github.com/code-423n4/2022-08-olympus/blob/70d7259581fe32647293ca4ff653ca3f2ad770b6/src/policies/Governance.sol#L167
Vulnerability details
Impact
User cannot vote for the proposal with same proposalId after Instruction module is updated.
Proof of Concept
If Alice voted for proposal 10 and her vote is greater than 0,
userVotesForProposal[10][Alice] > 0
and it is not reset to zero if she reclaims the vote. After that, if the instruction module is updated, the proposal id starts from 1. And Alice can not vote for proposal 10 because userVotesForProposal[10][Alice] is positive.Tools Used
Manual Review
Recommended Mitigation Steps
Add
userVotesForProposal[proposalId_][msg.sender] = 0
toGovernance.reclaimVotes
.