Even when the Vault contract is paused, the rebalance function is not paused
The rebalance function in the Vault and MultiStrategyVault contracts lacks a pause check, so it can still be called when the contract is paused. This allows performance fees to be collected from interest even though users cannot withdraw.
Submitted by klau5
Finding description and impact
When the contract is paused, rebalance is not paused. While users cannot withdraw, performance fees can still be collected from interest.
Proof of Concept
The rebalance should not be callable when paused (according to the documentation), but it can still be called even when paused. This means that while users cannot withdraw their investments from the Vault when paused, it’s still possible to collect performance fees on interest through the rebalance function. Also, MultiStrategyVault has the same issue.
function rebalance(
IVault.RebalanceCommand[] calldata commands
@> ) external override nonReentrant onlyRole(VAULT_MANAGER_ROLE) returns (bool success) {
success = true;
uint256 numCommands = commands.length;
for (uint256 i = 0; i < numCommands; ) {
if (commands[i].action == HARVEST_VAULT) {
_harvestAndMintFees();
}
unchecked {
i++;
}
}
}
Recommended Mitigation Steps
Add the whenNotPaused modifier to the rebalance function.
chefkenji (BakerFi) confirmed
Status: Mitigation confirmed. Full details in reports from 0xlemon and shaflow2.
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
The rebalance function is missing the whenNotPaused modifier, so it remains callable during a pause.
Impact
While the contract is paused and users cannot withdraw, performance fees can still be collected from interest through rebalance.
What the attacker needed
Contract is paused; caller has VAULT_MANAGER_ROLE
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 smart contract can have a pause switch to stop certain actions in an emergency. Here, the pause switch stops users from taking their money out, but it does not stop a special function called rebalance. That function can still take a cut of the interest earned, even while everything is supposed to be frozen.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.