TempleGold

TempleDAO
Foundry
25,000 USDC
View results
Submission Details
Severity: low
Valid

Users can withdraw their assets when the contract is in the paused state

Summary

Users can withdraw their assets when the contract is in the paused state

Vulnerability Detail

the contract inherits the pausable contract to allow the contract to prevent swaps as stated by comments, what i take from this, is that the protocol does not want assets entering or leaving the contract.

/// @notice Owner can pause user swaps from occuring
function pause() external override onlyElevatedAccess {
_pause();
}

The problem occurs becauser the whenNotPaused modifier is only added to the stakeFor function, this function is not added to the _withdrawFor function. this will allow the out flow of temple token from the contract when it is in paused state.It is recommended for the protocol to implement the whenNotPaused modifier to this function in order to stop an exploit while it is happening and to ensure safety of temple tokens

Impact

Lack of whenNotPaused modifier when withdrawing could cause the protocol to not stop an exploit while its happening and cause security concerns.

Code Snippet

https://github.com/Cyfrin/2024-07-templegold/blob/57a3e597e9199f9e9e0c26aab2123332eb19cc28/protocol/contracts/templegold/TempleGoldStaking.sol#L433

Tool used

Manual Review

Recommendation

add whenNotPaused modifier to _withdrawFor

Updates

Lead Judging Commences

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Only migrator should be able to perform actions when contract is paused.

Support

FAQs

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