Closed sherlock-admin4 closed 5 months ago
1 comment(s) were left on this issue during the judging contest.
DHTNS commented:
Low -> the function works as intended supply check is crucial for rugpull prevention + frontrunning on l2 is not guaranteed + owners can pause & ask people to withdraw + later they can unpause and retire the vault in a single txn so no funds lost or core functionality broken
Low -> wont fix. Though it can be front run, there is no monetary reason to do so. At most a few wei of the tokens will be unclaimed in the strategy.
BiasedMerc
medium
StrategyPassiveManagerVelodrome::retireVault() can be front-run to prevert retirement
Summary
When a manager calls
retireVault()
the function checks to ensure that only the initial supply minted during creation is present. However a malicious griefer can deposit a minimum amount to prevent thetotalSupply
check from passing, causing manager functionality to be broken.Vulnerability Detail
StrategyPassiveManagerVelodrome::retireVault()
The owner has the functionality to retire a vault when it is no longer utilised, however a malicious user can frontrun the call and add a minimum deposit to cause the call to revert due to the
totalSupply
check.The contract also cannot be already paused (which would prevent deposits) as the
panic()
function will call_pause()
which reverts if it's already paused: PausableUpgradeable::_pause()The modifier
whenNotPaused
will cause the call to revert if the contract is already paused.Impact
A malicious griefer can prevent a manager from utilising intended functionality of retiring a vault by frontrunning. The contract cannot be paused before calling
retireVault()
due to the_pause()
call within the function meaning owner has no way to prevent this. This breaks intended functionality of the contract, classifying this as a Medium risk issue.Code Snippet
StrategyPassiveManagerVelodrome::retireVault() PausableUpgradeable::_pause()
Tool used
Manual Review
Recommendation
Don't use
panic()
within theretireVault()
function to allow the manager to pause the contract before callingretireVault()
, preventing any deposit transactions front-running the admin'sretireVault()
call.