-
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
Loss of assets when rageQuit due to front-running token distribution #313
Comments
ydspa marked the issue as duplicate of #547 |
ydspa marked the issue as insufficient quality report |
ydspa marked the issue as not a duplicate |
ydspa marked the issue as sufficient quality report |
ydspa marked the issue as duplicate of #529 |
gzeon-c4 marked the issue as satisfactory |
gzeon-c4 changed the severity to 2 (Med Risk) |
gzeon-c4 marked the issue as duplicate of #469 |
gzeon-c4 marked the issue as partial-50 |
gzeon-c4 marked the issue as full credit |
gzeon-c4 marked the issue as partial-25 |
gzeon-c4 marked the issue as not a duplicate |
gzeon-c4 marked the issue as duplicate of #529 |
gzeon-c4 marked the issue as unsatisfactory: |
gzeon-c4 changed the severity to QA (Quality Assurance) |
gzeon-c4 marked the issue as grade-c |
Lines of code
https://github.com/code-423n4/2023-10-party/blob/06e6271b75a30f00ae2674e8c26f3eb9e89e75e5/contracts/party/PartyGovernance.sol#L500-L502
https://github.com/code-423n4/2023-10-party/blob/06e6271b75a30f00ae2674e8c26f3eb9e89e75e5/contracts/party/PartyGovernanceNFT.sol#L374-L405
Vulnerability details
Impact
Members face a risk of losing their assets if a
rageQuit
is front-ran by a token distribution. This vulnerability stems from the rageQuit function's dependency on the Party contract's token balance, which can be depleted by a distribution event.Proof of Concept
In Party contract, there is a state when a member can make a loss to other members. Let's see the scenario:
(1) When creating distribution, if setting
distributionsRequireVote
equals false, then members are allow to create a token distribution by moving the party's entire balance to theTokenDistributor
contract.https://github.com/code-423n4/2023-10-party/blob/06e6271b75a30f00ae2674e8c26f3eb9e89e75e5/contracts/party/PartyGovernance.sol#L500-L502
(2) When the party is allowed a member to rage quit, it essentially burn member's governance NFT and withdraw a fair share of fungible tokens from the party.
The withdrawn amount is calculated by the
balance of tokens in Party contract
. It then transferred the amount to the member and burn the NFT, and reduce the total voting power.https://github.com/code-423n4/2023-10-party/blob/06e6271b75a30f00ae2674e8c26f3eb9e89e75e5/contracts/party/PartyGovernanceNFT.sol#L374-L405
So a malicious user can observe a
rageQuit
transaction from a member and front-run it by callingdistribute
to create a distribution. Because the balance of tokens are transferred fromParty
contract toTokenDistributor
contract, so the member who rageQuit will receive nothing and has his NFTs burn. Because his NFT is burnt, he cannot claim the token in TokenDistribution contract.Tools Used
Manual
Recommended Mitigation Steps
Do not allow distribute to be call by member, it has to be through proposal voting and delay execution.
Assessed type
Timing
The text was updated successfully, but these errors were encountered: