Skip to content
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

Majority could steal ETH from sale using ArbitraryCallsProposal.sol before anyone calls PartyGovernance.sol#distribute #191

Open
code423n4 opened this issue Sep 19, 2022 · 2 comments
Labels
bug Something isn't working disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/PartyDAO/party-contracts-c4/blob/3896577b8f0fa16cba129dc2867aba786b730c1b/contracts/proposals/ListOnOpenseaProposal.sol#L350-L373
https://github.com/PartyDAO/party-contracts-c4/blob/3896577b8f0fa16cba129dc2867aba786b730c1b/contracts/proposals/ListOnZoraProposal.sol#L164-L204

Vulnerability details

Impact

ETH from sale can be stolen

Proof of Concept

When the sale of an NFT is completed, the ETH is sent to the party contract where it can be distributed. A malicious majority could create a ArbitraryCallsProposal.sol that sends them all the ETH in the contract. If no one notices what they are doing before the proposal goes through, they can use the call to steal all the ETH from the sale.

Tools Used

Manual Review

Recommended Mitigation Steps

Distribute should be called by the proposal during the final step to guarantee that the funds are distributed. This protects users because only one proposal can be active at once and before they could create the proposal to give themselves all the ETH, they would have to call the final step and distribute it instead.

@code423n4 code423n4 added 3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working labels Sep 19, 2022
code423n4 added a commit that referenced this issue Sep 19, 2022
@merklejerk merklejerk added the sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons label Sep 22, 2022
@merklejerk
Copy link
Collaborator

merklejerk commented Sep 22, 2022

This risk can be mitigated by a party choosing vigilant hosts (since they can veto any proposal). Reasonable governance configs (e.g., executionDelay) can also mitigate this. We do feel it's important that a party be able to hold the ETH from the sale and do something productive with it, so we do not want to add an automatic distribution at the end of sales.

@merklejerk merklejerk added the disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) label Sep 22, 2022
@HardlyDifficult
Copy link
Collaborator

This seems to be as designed and leans on governance to protect the party. The recommendation sacrifices capability. Reducing to Low risk for consideration.

Converting into a QA report for the warden.

@HardlyDifficult HardlyDifficult added QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax and removed 3 (High Risk) Assets can be stolen/lost/compromised directly labels Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Projects
None yet
Development

No branches or pull requests

3 participants