Submitted by TresDelinquentes, also found by KupiaSec, cccz, and 0xbrett8571
PartyGovernance uses a variable called passThresholdBps to determine the percentage of votes from the totalVotingPower a proposal needs to receive so it can pass.
The protocol also allows parties to change several governance options through SetGovernanceParameterProposal, including passThresholdBps.
This isnt in itself a problem, but the logic for checking if a proposal has passed contains a problem. Inside accept, we have a check called _areVotesPassing, which compares if the votes of the proposal, compared to the cached totalVotingPower of the proposal passes passThresholdBps. The issue is that we are using the global passThresholdBps, not a cached one.
This can lead to unwanted behavior during the voting lifecycle of a proposal and can even be exploited by party members to their gain.
Lets imagine a couple of scenarios:
Scenario A - passThresholdBps = 0.5e4 (50%)
Scenario B - Reverse of Scenario A - passThresholdBps = 0.5e4 (50%)
The actual creation of the proposals doesnt matter. Proposal B can be proposed before proposal A, as long as it gets executed first, it will have an effect on all previous proposals.
The scenarios here are endless: from grieving other users, maliciously exploiting the issue to get unpopular, unfavorable proposals to pass or blocking proposals that would have otherwise passed.
This also introduces more attack vectors for a 51% attack, as someone that has lets say 60% of the voting power, can just set passThresholdBps = 0.6e4 (60%) and easily block other users from getting their proposals accepted, while theirs will always pass.
Keep in mind that even completely non-malicious Parties can be affected by this negatively, as it introduces uncertainty and confusion during the voting stage.
We recommend caching passThresholdBps in a similar way as totalVotingPower is cached for proposals.
0xble (Party) confirmed
