Closed c4-bot-6 closed 8 months ago
Picodes changed the severity to QA (Quality Assurance)
Downgrading to Low as users can still change their vote but interesting report
Picodes marked the issue as grade-a
Picodes marked the issue as grade-b
Hi @Picodes , thanks for your judging. I want to add some additional information about the issue You mentioned that
Downgrading to Low as users can still change their vote but interesting report
Say we have two proposals, a good proposal X(for doing some good to the users or the system), and a bad proposal X + 1(for stealing tokens/assets to the malicious user), a user Alice is supposed to vote for the good proposal X, but due to the reorg, she votes for the bad proposal. Of course she can votes for the good proposal again, but it will be difficult for her to cancel votes on the malicious proposal. And if she doesn't cancel votes on the malicious proposal, the bad things might happen
@crazy4linux the user has time to override its previous vote, no? I still think considering the voting period, the frequency of proposals and the fact that it doesn't really make sense to vote before the proposal creation transaction was included on chain Low severity seems appropriate.
Lines of code
https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dao/Proposals.sol#L108-L109
Vulnerability details
Impact
In current implemenatation, the
ballotID
is calculated asnextBallotID
which increase one everytime. There is a scenario that:ballotID
is xballotID
is x + 1ballotID
is x, and Alice's propsal'sballotID
is x+1 nowIn the case above, User A is supposed to vote for Alice's proposal, but he votes for Bob's proposal after re-org
Proof of Concept
ballotID
is calculated as nextBallotID++Tools Used
VS
Recommended Mitigation Steps
Calculate
ballotID
as a hash of the proposal properties. This way, votes cannot be misdirected.Assessed type
Other