Closed c4-submissions closed 1 year ago
ydspa marked the issue as duplicate of #545
ydspa marked the issue as insufficient quality report
gzeon-c4 marked the issue as unsatisfactory: Invalid
I think report #351 wrote a good report as well
the frontrunning behavior is backed up by a POC
so politely think the severity is at least medium if not high
gzeon-c4 marked the issue as not a duplicate
gzeon-c4 marked the issue as duplicate of #414
gzeon-c4 marked the issue as satisfactory
gzeon-c4 marked the issue as not a duplicate
gzeon-c4 marked the issue as duplicate of #545
gzeon-c4 marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2023-10-party/blob/b23c65d62a20921c709582b0b76b387f2bb9ebb5/contracts/party/PartyGovernanceNFT.sol#L236 https://github.com/code-423n4/2023-10-party/blob/b23c65d62a20921c709582b0b76b387f2bb9ebb5/contracts/party/PartyGovernanceNFT.sol#L393
Vulnerability details
Impact
Update total voting power can impact live proposal
Proof of Concept
in the current implementation
the authority address can call increaseTotalVotingPower or decreaseTotalVotingPower
but calling such function can have unintended side effects
the codebase that use the state totalVotingPower is this function when comparing the voting power share of
suppose the totalVotingPower is reduced, the getVotingPowerShareOf return a large number and
can this function is used to calculate how much fund user can withdraw when rageQuit on party NFT,
in case when getVotingPowerShareOf return a large amount when total voting power is reduced, user can rage quit to suddenly withdraw more fund by backrun the total voting power reduction
or in case when the total voting power, they can frontrun to avoid loss
the POC below shows how the backrun works, party member withdraw more fund after the total voting power is reduced
can add this POC to PartyGovernanceNFT.t.sol
this is the regular withdraw without backrunning total power update, the user will get 0.1 ETH in recipient address
if we run
we are getting
but if we uncomment the code block
right after the total voting power is reduced by 50, user immediate rage quit and he can withdraw 0.2 ETH
Tools Used
Manual Review
Recommended Mitigation Steps
I think the protocol should snapshot the total voting power instead of let use a spot total voting power to let the updated live proposal and impact the user share amount
Assessed type
MEV