-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Contributor cannot update the delegate in crowdfunding contribution #314
Comments
ydspa marked the issue as duplicate of #334 |
ydspa marked the issue as insufficient quality report |
gzeon-c4 marked the issue as duplicate of #418 |
gzeon-c4 marked the issue as not a duplicate |
gzeon-c4 marked the issue as unsatisfactory: |
hi @gzeon-c4, I would like to ask for this issue being re-reviewed. The report shows that the contributor cannot change the delegate. The delegate is updated in Thank you. |
This failed to described the front-running attack. The delegate issue if not malicious can be fixed with calling delegateVotingPower. |
Lines of code
https://github.com/code-423n4/2023-10-party/blob/06e6271b75a30f00ae2674e8c26f3eb9e89e75e5/contracts/crowdfund/ETHCrowdfundBase.sol#L201-L208
https://github.com/code-423n4/2023-10-party/blob/06e6271b75a30f00ae2674e8c26f3eb9e89e75e5/contracts/crowdfund/InitialETHCrowdfund.sol#L300-L302
https://github.com/code-423n4/2023-10-party/blob/06e6271b75a30f00ae2674e8c26f3eb9e89e75e5/contracts/party/PartyGovernanceNFT.sol#L194-L198
Vulnerability details
Impact
A contributor's attempt to update their delegate during a contribution does not work as intended, and the contributor may allow the outdated delegate to use contributor's voting power.
Proof of Concept
When in initial crowdfund, the system permits delegate updates only if the contributor is the message sender or if no prior delegation exists. It updates the
delegationsByContributor
state variable.https://github.com/code-423n4/2023-10-party/blob/06e6271b75a30f00ae2674e8c26f3eb9e89e75e5/contracts/crowdfund/ETHCrowdfundBase.sol#L201-L208
However, there is an existed delegate, the contributor cannot update it to a new one. It is because the new delegate will be an argument used to mint a new party card.
https://github.com/code-423n4/2023-10-party/blob/06e6271b75a30f00ae2674e8c26f3eb9e89e75e5/contracts/crowdfund/InitialETHCrowdfund.sol#L300-L302
In PartyGovernanceNFT.mint function, it will not use the delegate from the argument but reverts to the delegate address from
delegatesByVoter
which is the old delegate.https://github.com/code-423n4/2023-10-party/blob/06e6271b75a30f00ae2674e8c26f3eb9e89e75e5/contracts/party/PartyGovernanceNFT.sol#L194-L198
It essentially denies the update of delegate in initial crowdfund contribution.
Tools Used
Manual
Recommended Mitigation Steps
Check if the minting is in initial phase, update the delegate to a new one in mint function.
Assessed type
Other
The text was updated successfully, but these errors were encountered: