-
Notifications
You must be signed in to change notification settings - Fork 0
chainNue - current refundDeposit
design may cause a claimBounty
experience bad for winner
#463
Comments
In such cases we simply suggest setting an incredibly long expiration date. This is not a 100% trustless protocol. In many areas we assume the issuer is trusted and we opt for flexibility over immutability in many areas. |
Agree with the sponsor comment |
Escalate for 21 USDC My explanation or wording seems not in the attacker point of view, but this issue is about the protocol design about with different point of view, this
most currently valid issues is on the 1st point of view, while mine is on the 2nd, which I think it should be also valid. this issue is similar to #266
Compared to mine, I think it is different in point of view, #266 is the Winner (which is malicious) do the deposit, and mine is someone (which is not the malicious winner) refund thus decrease the pool size resulting other winner can't claim due to lack of reward. If you read my
in #218 (which is part of #266 issues):
Another valid issue #458 (part of #266 issue):
While for the #275 is similar issue because of refund
this, inline with this (my) issue recommendation. Judge/sponsor comment about:
a suggestion won't resolve this issue, in which some depositor might just skip this suggestion and they just want to make it as short as possible whenever they want, later they won't realized when they refund, it will raise the issue. |
You've created a valid escalation for 21 USDC! To remove the escalation from consideration: Delete your comment. You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final. |
Escalation accepted Duplicate of. #266 |
This issue's escalations have been accepted! Contestants' payouts and scores will be updated according to the changes made on this issue. |
chainNue
medium
current
refundDeposit
design may cause aclaimBounty
experience bad for winnerSummary
current
refundDeposit
design may cause aclaimBounty
experience bad for winnerVulnerability Detail
Since OpenQ is a permission-less, anyone can fund a bounty. If someone
fundBounty
either with ERC20 or NFT token, then he can callrefundDeposit
if the_expiration
is passed.This
expiration
is to lock the deposit for a certain time and currently the OpenQ doesn't have anyMINIMUM EXPIRATION
state variable, so as long as theexpiration > 0
it is accepted.currently, the
refundDeposit
only check, if:When a Bounty is filled with a certain amount of reward for the winner, and it's fulfilled the required total reward needed, but turns out the
funder
did arefundDeposit
when the Bounty status is closed (which no-one can fund the bounty again), then the claim / reward will be lack of reward token. The balance of reward token inside the contract will be less than they should have to cover all the winners rewards.For example, in Tiered bounty type, this issue may lead to some winner (who are late to claim) doesn't get what they supposed to get, because of this
refundDeposit
(by some unknown person with small expiration time) decrease the balance of token.We can't blame the issuer, since they didn't do anything wrong, because anyone can do this
irresponsible
act, which fund a bounty token, andrefundDeposit
right after the Bounty is closed, which it's not good for protocol's experiences.Impact
claimBounty
might failed for late claimer because of the token is being refunded to depositor.Code Snippet
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/Bounty/Implementations/BountyCore.sol#L64-L93
Tool used
Manual Review
Recommendation
To prevent an early refund, make sure the
expiration
time is set to at least some minimum time, which can guarantee the deposit is not being withdrew before all winners claimed.Duplicate of #266
The text was updated successfully, but these errors were encountered: