Claim function can be lead into DDOS #403
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-552
satisfactory
satisfies C4 submission criteria; eligible for awards
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
Lines of code
https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/Quest.sol#L99
https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/RabbitHoleReceipt.sol#L117-L133
Vulnerability details
Impact
Quest.sol#Claim()
can be lead into out of gas error due to unbounded array and user can't unable to claim reward token.Proof of Concept
User can claim reward token via Receipt NFT contract. After claiming the reward token he still hold claimed mintReceipt and increase his balance. Also user can buy mint Receipt from other marketplace.
getOwnedTokenIdsOfQuest()
use 2SLOAD
opration and this gas cost is2100*2 = 4200
https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/RabbitHoleReceipt.sol#L117-L122
ethereum block gas limit is :
30_00_000
any user can lead into out of gas error after minting ~
700
( = 3000000/(2100*2) receipt lead into out of gas error and not able to claim reward token.this limit is can be easily achievable.
Tools Used
Manual Review
Recommended Mitigation Steps
When user claim reward token Mint Receipt should be burn.
The text was updated successfully, but these errors were encountered: