The stake() and lock() functions have a modifier whenNotPaused restricting use when the contract is paused. However, the privileged stakeFor() function allows operators to deposit and lock funds (for themselves or others) regardless of the pause state.
Lines of code
https://github.com/code-423n4/2024-03-abracadabra-money/blob/1f4693fdbf33e9ad28132643e2d6f7635834c6c6/src/staking/LockingMultiRewards.sol#L349
Vulnerability details
Impact
The
stake()
andlock()
functions have a modifierwhenNotPaused
restricting use when the contract is paused. However, the privilegedstakeFor()
function allows operators to deposit and lock funds (for themselves or others) regardless of the pause state.Proof of Concept
stakeFor() is missing the
whenNotPaused
modifier.Tools Used
Manual Analysis
Recommended Mitigation Steps
Add the missing modifier to the function so that deposit are blocked when contract is paused.
Assessed type
Other