-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
missing isEpochClaimed validation #132
Comments
Picodes marked the issue as duplicate of #316 |
Picodes marked the issue as selected for report |
Picodes marked the issue as satisfactory |
ith-harvey marked the issue as sponsor confirmed |
The series of calls they are suggesting are possible: They should not be able to get these rewards because |
ith-harvey marked the issue as sponsor disputed |
Lines of code
https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-core/src/RewardsManager.sol#L135-L198
Vulnerability details
Impact
User can claim rewards even when is already claimed
Proof of Concept
The _claimRewards function is using to calculate and send the reward to the caller but this function is no validating if isEpochClaimed mapping is true due that in claimRewards function is validated, see the stament in the following lines:
https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-core/src/RewardsManager.sol#L114-L125
Now the moveStakedLiquidity is calling _claimRewards too without validate isEpochClaimed mapping:
https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-core/src/RewardsManager.sol#L135-L159
Also we can see in the _claimRewards function there is no validation is isEpochClaimed is true, this allow a malicius user claimReward first and then move his liquidity to other bucket or the same bucket claiming the reward each time that he want.
Tools Used
manual
Recommended Mitigation Steps
check if the isEpochClaime is true and revert in the _claimReward function
Assessed type
Invalid Validation
The text was updated successfully, but these errors were encountered: