increaseTotalVotingPower()
can be front-ran by an attacker with a call to rageQuit()
in order to withdraw more assets than the attacker should be able to claim.
#545
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
insufficient quality report
This report is not of sufficient quality
primary issue
Highest quality submission among a set of duplicates
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2023-10-party/blob/b23c65d62a20921c709582b0b76b387f2bb9ebb5/contracts/party/PartyGovernanceNFT.sol#L393
Vulnerability details
Overview of the vulnerability / PoC
The function
increaseTotalVotingPower
inPartyGovernanceNFT
does not have a front-running protection againstrageQuit()
allowing a user to walk away with more assets than he should.An example of the attack
A party member exists in a party which has a total voting power of
100e18
has a governance NFT token which has an id of5
. This governance NFT token has a voting power of10e18
meaning that the user owns 10% share of the party.An authority decides to increase the total voting power of the party (could be by minting new governance NFT cards for a user). If the
totalVotingPower
gets increased, that means that each member's share of the party's assets will be decreased, you can see the maths of this at https://github.com/code-423n4/2023-10-party/blob/b23c65d62a20921c709582b0b76b387f2bb9ebb5/contracts/party/PartyGovernanceNFT.sol#L393:https://github.com/code-423n4/2023-10-party/blob/b23c65d62a20921c709582b0b76b387f2bb9ebb5/contracts/party/PartyGovernanceNFT.sol#L154
The member will front-run the
increaseTotalVotingPower
call with a call torageQuit()
inPartyGovernanceNFT
to to walk away with his funds.The member will be able to walk away with funds amount calculated based on the old
totalVotingPower
which would be more than the funds the attacker would be able to claim happen he rage quits after the total voting power gets increased.Impact
A user can claim more assets than he should claim happen the total voting power of a party gets increased by an authority for some reason.
Remediation
A potential fix is to enable a member to rage quit only after a specific period within him requesting to rage quit. Something like this:
Assessed type
MEV
The text was updated successfully, but these errors were encountered: