In the BaseGauge.sol
contract the stake
function does not check if the gauge has been shut down by the admin through the emergencyShutdown
function in the GaugeController
, allowing users to continue staking even when the gauge is supposed to be inactive.
The vulnerability arises from the stake
function, which allows users to stake tokens in the gauge. However, there is no check to verify if the gauge has been shut down by the admin through the emergencyShutdown
function in the GaugeController
. This omission allows users to continue staking tokens even when the gauge is supposed to be inactive, undermining the emergency controls put in place by the protocol.
Consider the following scenario:
The admin uses the emergencyShutdown
function in the GaugeController
to shut down a gauge due to an emergency or critical issue.
Despite the shutdown, users can still call the stake
function in the BaseGauge
contract to stake tokens.
This leads to an inconsistency where the gauge is supposed to be inactive, but users are still able to interact with it and stake tokens.
By allowing users to continue staking tokens in a shut-down gauge, the protocol's emergency controls are undermined. This can lead to potential financial losses, as users may stake tokens in a gauge that is not supposed to be active. It also creates operational inconsistencies and can complicate the resolution of the emergency situation.
Manual Review
To mitigate this vulnerability, add a check in the stake
function to verify if the gauge has been shut down by the admin through the emergencyShutdown
function in the GaugeController
.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.