function withdraw(uint256 _withdrawId) external override {
// Some checks here...
relock();
Therefore, if VLCVX's owner sets isShutdown to true, the withdraw() function will permanently be DOSed as relock() will always revert.
Impact
Should VLCVX's owner decide to shutdown the contract, the relock() function in VotiumStrategy.sol will always revert. As a result, withdrawals will permanently be DOSed as withdraw() in VotiumStrategy.sol and AfEth.sol call relock() in their logic.
This leads to a loss of funds for users as they will no longer be able to withdraw their ETH using the withdraw() function.
Additionally, since relock() is the only function that withdraws unlockable CVX from the VLCVX contract, all CVX will forever be stuck in as there is no other way to withdraw the locked CVX.
Recommended Mitigation
In relock(), consider calling lock() only when isShutdown is false:
Lines of code
https://github.com/code-423n4/2023-09-asymmetry/blob/main/contracts/strategies/votium/VotiumStrategy.sol#L145-L148
Vulnerability details
Bug Description
In
VotiumStrategy.sol
, therelock()
function is used to withdraw all unlockable CVX and then lock an appropriate amount of CVX again.It does so by calling
lock()
of the VLCVX contract:VotiumStrategy.sol#L145-L148
Where:
cvxAmountToRelock
is the total amount of CVX withdrawn - the amount of CVX used for pending withdrawals.In the VLCVX contract, it is possible for
lock()
to revert ifisShutdown
is set totrue
:CvxLockerV2.sol#L1465
Note that the contract's owner can call
shutdown()
to setisShutdown
totrue
.As such, if
isShutdown
is set totrue
,relock()
will always revert as it does not check the value ofisShutdown
before making a call tolock()
.relock()
is called by thewithdraw()
function:VotiumStrategy.sol#L109-L117
Therefore, if VLCVX's owner sets
isShutdown
totrue
, thewithdraw()
function will permanently be DOSed asrelock()
will always revert.Impact
Should VLCVX's owner decide to shutdown the contract, the
relock()
function inVotiumStrategy.sol
will always revert. As a result, withdrawals will permanently be DOSed aswithdraw()
inVotiumStrategy.sol
andAfEth.sol
callrelock()
in their logic.This leads to a loss of funds for users as they will no longer be able to withdraw their ETH using the
withdraw()
function.Additionally, since
relock()
is the only function that withdraws unlockable CVX from the VLCVX contract, all CVX will forever be stuck in as there is no other way to withdraw the locked CVX.Recommended Mitigation
In
relock()
, consider callinglock()
only whenisShutdown
isfalse
:VotiumStrategy.sol#L145-L148
Assessed type
DoS