Potential DoS when removing keeper gauge
Removing a keeper gauge in the InflationManager does not check whether a TopUpActionFeeHandler still references it, so the killed gauge makes fee reporting revert. Any top-up execution then fails until governance points the fee handler at a new gauge, which the text says could delay or block top-ups during volatile markets.
Submitted by shenwilly
Impact
When _removeKeeperGauge is called, there is no guarantee that the keeper gauge isn’t currently in use by any TopUpActionFeeHandler. If it’s still in use, any top up action executions will be disabled as reporting fees in KeeperGauge.sol will revert:
function reportFees(
address beneficiary,
uint256 amount,
address lpTokenAddress
) external override returns (bool) {
...
require(!killed, Error.CONTRACT_PAUSED); // gauge is killed by InflationManager
...
return true;
}
If this happened during extreme market movements, some positions that require a top up will not be executed and be in risk of being liquidated.
Proof of Concept
- Alice registers a top up action.
- Governance calls
InflationManager.removeKeeperGauge, replacing an old keeper gauge. However, governance forgot to callTopUpActionFeeHandler.prepareKeeperGaugesoTopUpActionFeeHandler.getKeeperGaugestill points to the killed gauge. - Market moved and Alice’s position should now be executed by keepers, however any attempt to execute will revert: > Keeper calls TopUpAction.execute(); > _payFees(); > IActionFeeHandler(feeHandler).payFees(); > IKeeperGauge(keeperGauge).reportFees(); > reverts as gauge is already killed
- Governance noticed and calls
prepareKeeperGaugewith a 3 days delay. - Alice’s position got liquidated before the change is executed.
Recommended Mitigation Steps
Consider adding an on-chain check to ensure that the keeper gauge is not in use before removing them.
Alex the Entreprenerd (judge) commented:
I believe the warden has shown a situation in which calling
_removeKeeperGaugecan causepayFeesto revert, making it impossible (for a time) for fees to be paid.I do not believe the impact will extend beyond:
- Potential loss of yield (or delay)
- Need for governance to set a new gauge
I disagree with the statement:
Alice's position got liquidated before the change is executed.as no liquidation should be contingent on fees being paid from this function.Because the finding shows how the system for fees can be stopped due to external conditions, I agree with Medium Seveirty
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the removal function does not verify that no fee handler still references the gauge being killed, leaving a stale pointer to a disabled contract.
Impact
Top-up executions could be disabled for a period, which the reporter says may put positions at risk of liquidation during extreme market movements, though the judge disputed that liquidation would follow and rated it medium.
What the attacker needed
Governance removes a gauge still in use; fee handler not updated in time
The fix
The text recommends adding an on-chain check that the keeper gauge is not in use before it is removed.
How it was found
- Alice registers a top up action.
- Governance removes the old keeper gauge without updating the fee handler, so it still points at the killed gauge.
- The market moves and keepers try to execute Alice's top up, but the fee payment reverts because the gauge is killed.
- Governance notices and schedules a fee handler update with a three day delay.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A gauge is a contract that records and pays out fees. When governance swaps it for a new one, the old gauge is switched off, but another contract can still be pointing at it. Because the switched-off gauge refuses to accept fee reports, the whole top-up action fails until someone updates the pointer.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.