Closed github-actions[bot] closed 1 year ago
Escalate for 50 USDC
Should be Medium as having user mistake of calling claimRewards() with epochToClaim_ > currentBurnEpoch
as a prerequisite. It is a dup of #122
Escalate for 50 USDC Should be Medium as having user mistake of calling claimRewards() with
epochToClaim_ > currentBurnEpoch
as a prerequisite. It is a dup of #122
You've created a valid escalation for 50 USDC!
To remove the escalation from consideration: Delete your comment. To change the amount you've staked on this escalation: Edit your comment (do not create a new 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
Valid dupe of #122
Escalation accepted
Valid dupe of #122
This issue's escalations have been accepted!
Contestants' payouts and scores will be updated according to the changes made on this issue.
Blockian
high
Permanent freezing of unclaimed yield
Summary
A user can accidentally freeze potential rewards from the
RewardsManager.sol
Vulnerability Detail
On
claimRewards
inRewardsManager
contract theepochToClaim_
is not limited to thecurrentBurnEpoch()
, thus allowing a user to sendepochToClaim_ > currentBurnEpoch
, renderingisEpochClaimed[tokenId_][epochToClaim_]
true from all epochs from0 - epochToClaim_
and disallowing the user rewards he may have received in future epochsepochToClaim_ no limit check
Impact
By accidentally sending the wrong epoch a user may freeze unclaimed yield with no way of getting it back
Code Snippet
POC
Add this test to the
RewardsManager.t.sol
Tool used
Manual Review
Recommendation
There are 2 main ways to fix this issue. Either limit the
for
loops that depend onepochToClaim_
for example instead ofuse
Which is a BAD solution (explanation in detail in the next issue)
Or simply add a require statement when calling
claimRewards
Which is a better solution
Duplicate of #122