This repository has been archived by the owner on May 26, 2023. It is now read-only.
seyni - Funders can deny rewards to last claimants by calling refundDeposit
between tiers claims
#64
Labels
Duplicate
A valid issue that is a duplicate of an issue with `Has Duplicates` label
High
A valid High severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
seyni
high
Funders can deny rewards to last claimants by calling
refundDeposit
between tiers claimsSummary
refundDeposit
can be called between tiers claims which will result in last claimants not receiving their rewards.Vulnerability Detail
Let's say several funders contributed to a
TieredPercentageBountyV1
bounty 1000 USDC and withpayoutSchedule == [50,30,20]
. When claimants have validated their obligation, they will be able to callpermissionedClaimTieredBounty
. Consider the following scenario:permissionedClaimTieredBounty
and together claim 50% of the available USDC or 500 USDC.permissionedClaimTieredBounty
which will revert because inTieredPercentageBountyV1
,claimTiered
will call_transferToken
with 500 USDC asclaimedBalance
.There is several scenarios which will all eventually lead for (at least) the last claimant to not receive his rewards.
Impact
Funders can grief the last claimants by calling
refundDeposit
between tiers claims. Winners of a competition will not get their rewards.Code Snippet
TieredPercentageBountyV1.sol#L104-L120
Tool used
Manual Review
Recommendation
The origin of this issue is that the
refundDeposit
function can be called by funder after the end of a competition. Therefore, I recommend to stop refunds after the closing of a competition by usingrequire(status == OpenQDefinitions.OPEN, Errors.CONTRACT_IS_CLOSED);
inBountyCore.refundDeposit
.With this added, if nobody claims the rewards the funds would be locked in the contract. Thus, I additionally recommend adding a permissioned function for the bounty issuer to retrieve funds if necessary when the bounty is closed.
Duplicate of #266
The text was updated successfully, but these errors were encountered: