Unlike questFee_
, royaltyFee_
is missing Upper Limit
#651
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
grade-a
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/RabbitHoleReceipt.sol#L90-L93
Vulnerability details
In the QuestFactory.sol contract, as expected there is an upper limit on the
questFee_
so that no unjust amount is set for thequestFee_
However, in RabbitHoleReceipt.sol, the function
setRoyaltyFee()
does not set an upper limit to theroyaltyFee_
parameter. Thus any arbitrarily large values can be set forroyaltyFee_
https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/RabbitHoleReceipt.sol#L90-L93
setting large values of
royaltyFee_
will change all calculations in the contract whereverroyaltyFee_
is involved and very large sums of money will flow towards royalty fees. Royalty fee is meant to be a small amount, however here that is not the case.Recommended Mitigation Steps
modify the
setRoyaltyFee()
function to set an upper limit to theroyaltyFee_
. A code similar to the following can be usedThe text was updated successfully, but these errors were encountered: