Incorrect Balance Check in Validator Redelegation Process May Block Legitimate Rebalancing Operations
The redelegation function in the StakingManager contract checked the contract's HyperEVM balance, but the funds being redelegated actually sit on HyperCore. This could make legitimate rebalancing operations revert even when the HyperCore balance was sufficient, disrupting validator rebalancing.
Submitted by yaioxy, also found by 0xG0P1, 0xpiken, adamIdarrha, Atharv, DemoreX, dobrevaleri, falconhoof, FalseGenius, givn, holydevoti0n, Infect3d, komronkh, KupiaSec, LSHFGJ, marchev, Ragnarok, rouhsamad, VAD37, vangrim, zhaojohnson, and zzebra83
Finding description and impact
The processValidatorRedelegation function in the StakingManager contract contains an incorrect balance check that could prevent legitimate rebalancing operations from being executed. The function checks the HyperEVM balance of the StakingManager contract, but the funds being redelegated exist on HyperCore, not on the HyperEVM.
According to the documentation, HYPE staking on Hyperliquid happens within HyperCore. The rebalancing process is designed to delegate/undelegate funds between validators and staking balance on HyperCore without those funds ever leaving the HyperCore environment. However, the current implementation incorrectly checks the StakingManager balance that is on HyperEVM.
When the ValidatorManager’s closeRebalanceRequests function is called, it calculates the total amount to be redelegated and then calls processValidatorRedelegation on the StakingManager:
function closeRebalanceRequests(
address stakingManager,
address[] calldata validators
) external whenNotPaused nonReentrant onlyRole(MANAGER_ROLE) {
// ...
uint256 totalAmount = 0;
for (uint256 i = 0; i < validators.length; ) {
// ...
totalAmount += request.amount;
// ...
}
// Trigger redelegation through StakingManager if there's an amount to delegate
if (totalAmount > 0) {
IStakingManager(stakingManager).processValidatorRedelegation(totalAmount);
}
}
In the StakingManager’s processValidatorRedelegation function, there’s an incorrect balance check:
function processValidatorRedelegation(uint256 amount) external nonReentrant whenNotPaused {
require(msg.sender == address(validatorManager), "Only ValidatorManager");
require(amount > 0, "Invalid amount");
@> require(address(this).balance >= amount, "Insufficient balance");
_distributeStake(amount, OperationType.RebalanceDeposit);
}
This incorrect balance check could cause legitimate rebalancing operations to fail if the StakingManager doesn’t have sufficient HYPE balance, even though the HyperCore balance is adequate for the redelegation. This would prevent the protocol from properly rebalancing funds between validators, which could lead to operational disruptions and reduced protocol performance.
Recommended Mitigation Steps
Remove the incorrect balance check from the processValidatorRedelegation function:
function processValidatorRedelegation(uint256 amount) external nonReentrant whenNotPaused {
require(msg.sender == address(validatorManager), "Only ValidatorManager");
require(amount > 0, "Invalid amount");
- require(address(this).balance >= amount, "Insufficient balance");
_distributeStake(amount, OperationType.RebalanceDeposit);
}
Kinetiq confirmed
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 function validated the contract's HyperEVM balance instead of the HyperCore balance that actually backs the redelegation.
Impact
Legitimate rebalancing operations could revert when the HyperEVM balance was lower than the amount, even though the HyperCore balance was adequate, potentially causing operational disruption.
What the attacker needed
Protocol uses HyperCore for staking; rebalancing request exceeds HyperEVM balance
The fix
The incorrect balance check should be removed from the redelegation function.
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 holds funds in two separate places: one balance on the HyperEVM chain and another on HyperCore. The code checked the wrong place before moving funds between validators, so a valid move could be refused even though the money was there. The fix is to remove that misplaced check.
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.