TempleGold

TempleDAO
Foundry
25,000 USDC
View results
Submission Details
Severity: medium
Invalid

Lack of access control in TempleGoldStaking::getReward() allow force Reward Claim

Summary

TempleGoldStaking::getReward() allows any user to force out the reward of other users in the contract.

Vulnerability Details

TempleGoldStaking::getReward() allows any user to force out the reward of other users in the contract. TempleGoldStaking::getReward() makes a sub call to _getReward() which contains the logic for reward claiming. And neither of the functions prevent users from forcing other users to claim their reward.
https://github.com/Cyfrin/2024-07-templegold/blob/da199ee9316665e3ea9006ce9c9f5a7fd7cbc605/protocol/contracts/templegold/TempleGoldStaking.sol#L394-L396

function getReward(address staker, uint256 index) external override updateReward(staker, index) {
_getReward(staker, staker, index);
}

Impact

The function grants an attacker an unpermissioned access into other users account, albeit limited access.

Tools Used

Manual

Recommendations

Add access control in TempleGoldStaking::getReward() ensures users can only operate on their accounts.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.