User receives less rewards than they are eligible for if first passed BLS key is inactive
The claimRewards function only refreshes the accumulated ETH-per-LP share when the first supplied BLS key is still part of the syndicate, so for other key orderings the reward distribution uses a stale share value. A user could therefore receive fewer rewards than they are eligible for.
Submitted by Trust
StakingFundsVault has the claimRewards() function to allow users to withdraw profits.
function claimRewards(
address _recipient,
bytes[] calldata _blsPubKeys
) external nonReentrant {
for (uint256 i; i < _blsPubKeys.length; ++i) {
require(
liquidStakingNetworkManager.isBLSPublicKeyBanned(_blsPubKeys[i]) == false,
"Unknown BLS public key"
);
// Ensure that the BLS key has its derivatives minted
require(
getAccountManager().blsPublicKeyToLifecycleStatus(_blsPubKeys[i]) == IDataStructures.LifecycleStatus.TOKENS_MINTED,
"Derivatives not minted"
);
if (i == 0 && !Syndicate(payable(liquidStakingNetworkManager.syndicate())).isNoLongerPartOfSyndicate(_blsPubKeys[i])) {
// Withdraw any ETH accrued on free floating SLOT from syndicate to this contract
// If a partial list of BLS keys that have free floating staked are supplied, then partial funds accrued will be fetched
_claimFundsFromSyndicateForDistribution(
liquidStakingNetworkManager.syndicate(),
_blsPubKeys
);
// Distribute ETH per LP
updateAccumulatedETHPerLP();
}
// If msg.sender has a balance for the LP token associated with the BLS key, then send them any accrued ETH
LPToken token = lpTokenForKnot[_blsPubKeys[i]];
require(address(token) != address(0), "Invalid BLS key");
require(token.lastInteractedTimestamp(msg.sender) + 30 minutes < block.timestamp, "Last transfer too recent");
_distributeETHRewardsToUserForToken(msg.sender, address(token), token.balanceOf(msg.sender), _recipient);
}
}
The issue is that updateAccumulatedETHPerLP() is not guaranteed to be called, which means the ETH reward distribution in _distribute would use stale value, and users will not receive as many rewards as they should.
updateAccumulatedETHPerLP is only called if the first BLS public key is part of the syndicate. However, for the other keys it makes no reason not to use the up to date accumulatedETHPerLPShare value.
Impact
User receives less rewards than they are eligible for if first passed BLS key is inactive.
Recommended Mitigation Steps
Call updateAccumulatedETHPerLP() at the start of the function.
vince0656 (Stakehouse) confirmed and commented:
This is a dupe of issue 408 (M-28)
I’ve asked the warden to come in and highlight the differences between this and M-28.
Hi. Both rewards show different ways in which users don’t receive their eligible rewards.
This report talks about use of an old accumulatedETHPerLPShare in the call to _distributeETHRewardsToUserForToken(). It will happen in any case where we don’t go into the if block. Using an old value means users won’t receive as much rewards as have been unlocked. The second report (M-28) is about _claimFundsFromSyndicateForDistribution not being called although it should be. suppose the blsPubKeys array has first element which is no longer part of syndicate, but the rest of the array are part of syndicate. Then we skip claiming funds from them. Therefore, there will be less funds to give away as rewards.
One report is about incorrect share value leak, the second is about total rewards leak.
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 refresh of the accumulated reward-per-share value is placed inside a conditional tied to the first BLS key, so it is skipped whenever that key is not part of the syndicate.
What the attacker needed
User holds LP tokens for a BLS key; first supplied BLS key is inactive
The fix
The accumulated ETH-per-LP value should be refreshed at the start of the function rather than only inside the first-key condition.
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 staking contract tracks how much reward each share of the pool has earned. That running total is only updated in one specific situation, so when a user claims in other situations the contract pays out using an old figure. The user gets less money than they should.
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.