The claimRewards()
function currently calculates the amountToClaim
based on the idToCreationTimestamp
.
But it does not account for the actual duration of tokens held within the contract.
This approach allows for potential manipulation by malicious actors who could claim excessive rewards.
PoC:
Manual review
To address this vulnerability, it is recommended to implement a time-based calculation for amountToClaim
that begins when a user deposits tokens and concludes when they withdraw. This ensures that rewards are calculated accurately based on the actual time period during which tokens are staked.
High severity, this allows users to claim additional rewards without committing to intended weekly staking period via multi-deposit/deposit right before claiming rewards.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.