-
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
In some cases, crowd fund can not be finalized due to minContribution
restriction.
#401
Comments
ydspa marked the issue as duplicate of #552 |
ydspa marked the issue as insufficient quality report |
gzeon-c4 marked the issue as unsatisfactory: |
gzeon-c4 marked the issue as unsatisfactory: |
1 similar comment
gzeon-c4 marked the issue as unsatisfactory: |
gzeon-c4 changed the severity to 2 (Med Risk) |
gzeon-c4 marked the issue as not a duplicate |
gzeon-c4 marked the issue as duplicate of #505 |
@gzeon-c4 We believe that we have provided the adequate code reference and sample case that would simulate the actual issue. From the submisstion, Lets see one case.
min amount = 3;
max amount = 4;
Total value = 10.
Following three transaction,
1st ==> 4 ETH
2nd ==> 4 ETH.
Now, remaining 2 would be utilized to finalize.
when another user send 4 ETH, the function first takes 2ETH and refund the remaining 2ETH. Finalized will be called.
Now, min amount check will come and revert due to min cap which is 3 ETH. We have not find any issue which are related to this issue in the known section. we kindly request judge to give second look and share your feedback. Thanks! |
This submission lacked ANY reference to |
Lines of code
https://github.com/code-423n4/2023-10-party/blob/b23c65d62a20921c709582b0b76b387f2bb9ebb5/contracts/crowdfund/ETHCrowdfundBase.sol#L196-L273
Vulnerability details
Impact
Crowd fund can not be finalized in some cases.
Since this affects the core feature of the party protocol, we are raising this as high.
Proof of Concept
An user can contribute to a crowdfund by calling the functions
contribute
,batchContribute
,batchContributeFor
functions inInitialETHCrowdfund.sol
contract.The function
_contribute
checks for allowed user by the keeper. Checkvoting power will be calculated by calling the function _processContribution.
when we look at the function
_processContribution
https://github.com/code-423n4/2023-10-party/blob/b23c65d62a20921c709582b0b76b387f2bb9ebb5/contracts/crowdfund/ETHCrowdfundBase.sol#L196-L273
The above function checks for min contribution and max contribution and ensure that the amount is not greater than max contribution and not less than min contribution.
when the sum of input amount and total amount (totalContributions + amount) exceeds the max contribution value, the amount which satisfy the max contribution is deducted from input amount and remaining is refunded to user.
and then below checks will come
https://github.com/code-423n4/2023-10-party/blob/b23c65d62a20921c709582b0b76b387f2bb9ebb5/contracts/crowdfund/ETHCrowdfundBase.sol#L255-L258
Lets see one case.
min amount = 3;
max amount = 4;
Total value = 10.
Following three transaction,
1st ==> 4 ETH
2nd ==> 4 ETH.
Now, remaining 2 would be utilized to finalize.
when another user send 4 ETH, the function first takes 2ETH and refund the remaining 2ETH. Finalized will be called.
Now, min amount check will come and revert due to min cap which is 3 ETH.
Tools Used
Manual review.
Recommended Mitigation Steps
We suggest to introduce a bool flag and set it true when finalize is called.
Once finalize is called, do not check for min contribution amount by using the above bool flag.
Assessed type
Invalid Validation
The text was updated successfully, but these errors were encountered: