-
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
ETHCrowdfundBase.delegationsByContributor can be manipulated via zero-value front-running donations #334
Comments
Contributors can update delegate later in Party, the likelihood is very low that a contributor to be a smart contract designed for interacting with Party protocol but without implementing interfaces such as File: contracts\party\PartyGovernance.sol
451: function delegateVotingPower(address delegate) external {
452: _adjustVotingPower(msg.sender, 0, delegate);
453: } QA; L |
ydspa marked the issue as insufficient quality report |
ydspa marked the issue as primary issue |
gzeon-c4 marked the issue as duplicate of #418 |
gzeon-c4 marked the issue as satisfactory |
Hi @gzeon-c4 could you review the labels for this? After the change to "satisfactory" is this meant to stay with "insufficient quality report"? TY |
it is satisfactory, |
Hey @gzeon-c4 This issue shouldn't be a full duplicate of #418 as it does not show the core problem of the attack described in #418. #418 showcases that a malicious user can front run a contribution and set themselves or another address as a delegate and then the contributor won't be able to change their delegate through their contribution, because of this check in address delegate_ = delegationsByVoter[owner];
if (delegate_ != address(0)) {
delegate = delegate_;
} While the provided PoC of this issue works, it incorrectly points to the problem being in We believe this can be should be marked as partial-50, as the PoC showcases the issue, but the actual report doesn't point to where the actual root cause of the issue is. Cheers. |
gzeon-c4 marked the issue as partial-50 |
Lines of code
https://github.com/code-423n4/2023-10-party/blob/b23c65d62a20921c709582b0b76b387f2bb9ebb5/contracts/crowdfund/ETHCrowdfundBase.sol#L202
Vulnerability details
ETHCrowdfundBase
updates a contributor's delegation at each new contribution:If we look closely at how the
if
condition is formulated, we can tell that:oldDelegate
would be non-zero)This could cause a problem for
contributor
addresses who are for example contracts designed to interact withparty
but for the crowdfunding phase rely on other addresses to have their position built.Impact
A malicious actor can monitor contributions on behalf off addresses without prior contributions; when one comes, it can front-run it, contribute a 0 amount to that victim address, setting themselves as delegate.
If no further contributions are made, originating directly from the victim address, this delegation may give the attacker access to the victim's voting power and funds.
Proof of Concept
The following PoC shows how a front-running zero-value donation to a fresh contributor sets the attacker as delegate for the contributor:
Tools Used
Code review, Foundry
Recommended Mitigation Steps
Whenever it is a different address making the first donation for a contributor, automatically set their delegate to the contributor itself rather than what's specified by the caller:
Assessed type
ERC721
The text was updated successfully, but these errors were encountered: