Submitted by Banditx0x
A delegate can subtract their own voting weight from the voting choice of another delegate, even if that user isnt a transcoder. Since they are not a transcoder, they dont have their votes initially increased by the amount delegated to them, voting weight is still subtracted from the tally of their vote choice.
Maliciously, this could be used to effectively double ones voting power, by delegating their votes to a delegator who is about to vote for the choice which they dont want. It can also occur accidentally, for example when somebody delegates to a transcoder who later switches role to delegate.
When a user is not a transcoder, their votes are determined by the amount they have delegated to the delegatedAddress, and does not increase when a user delegates to them:
Lets say that this delegator (Alice) has 100 votes and votes For, then another delegator(Bob) has delegated 1000 votes to Alice. As stated above, Alice doesnt get the voting power of Bobs 1000 votes, so the For count increases by 100.
Bob now votes, and _handleVotesOverrides is called. In this function, the first conditional, if isTranscoder will return false as Bob is not self-delegating.
Then, there is a check that the address Bob has delegated to has voted. Note that there is a missing check of whether the delegate address is a transcoder. Therefore the logic inside if (delegateVoter.hasVoted) is executed:
The logic reduces the tally of whatever choice Alice voted for by Bobs weight. Alice initially voted For with 100 votes, and then the For votes is reduced by Bobs 1000 votes. Lets say that Bob votes Against. This will result in an aggregate 900 vote reduction in the For tally and +1000 votes for Agaisnt after Alice and Bob has finished voting.
If Alice was a transcoder, Bob will be simply reversing the votes they had delegated to Alice. However since Alice was a delegate, they never gained the voting power that was delegated to her.
Bob has effectively gained the ability to vote against somebody elses votes (without first actually increasing their voting power since they are not a transcoder) and can vote themselves, which allows them to manipulate governance.
There should be a check that a delegate is a transcoder before subtracting the tally. Here is some pseudocode:
This is an edit of the conditional of the function _handleOverrides. This ensures that the subtraction of vote tally is only performed when the delegate is a voter AND the delegate is a transcoder. This should fix the accounting/subtraction issue of vote tally for non-transcoder delegates.
Invalid Validation
victorges (Livepeer) confirmed
victorges (Livepeer) mitigated:
