Overwriting Timestamp Clash would allow bad Actors to Insert Sensitive Voting PowerSnapshot Since it would not end up in Storage #290
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
insufficient quality report
This report is not of sufficient quality
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2023-10-party/blob/main/contracts/party/PartyGovernance.sol#L1032
Vulnerability details
Impact
Bad Actors can insert multiple Sensitive Voting PowerSnapshot at a single timestamp and interact with the contract without the data ending up in storage, all this can happen in a single function call. Bad Actor can use this to acquire extra voting power by delegating.
Proof of Concept
As seen in the comment description and implementation above if the timestamp is the same it should be overwritten. So in simple term if series of voting Power snapshot is to be inserted into storage for a voter at a given timestamp only the last will be saved in storage. The problem with this is a bad actor can take advantage of this and use the voting power before it would be overwritten, a sample attack would look like this
Using a single function call and timestamp
Note: Attack does not necessarily have to follow this pattern, but this vulnerability can be taken advantage of.
Tools Used
Manual Review
Recommended Mitigation Steps
Instead of overwriting snapshot at same timestamp before storage, the protocol would be more secure not allowing snapshot at the same timestamp at all in the first place. This can be done by validating that previous timestamp is not equal to block.timestamp at the time of inserting snapshot i.e in the _adjustVotingPower(...) & _rebalanceDelegates(...) functions
Assessed type
Timing
The text was updated successfully, but these errors were encountered: