Skip to content
Business logic Audit finding Intermediate

Funds are not claimed from syndicate for valid BLS keys of first key is invalid (no longer part of syndicate).

The claimRewards function only calls the syndicate claim when the first BLS public key is still part of the syndicate. If the first key is no longer part of the syndicate, rewards for other valid keys are not claimed, reducing user rewards.

Trust Follow

Originally disclosed on Code4rena

Submitted by Trust

https://github.com/code-423n4/2022-11-stakehouse/blob/4b6828e9c807f2f7c569e6d721ca1289f7cf7112/contracts/liquid-staking/StakingFundsVault.sol#L218

claimRewards in StakingFundsVault.sol has this code:

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();
}

The issue is that if the first BLS public key is not part of the syndicate, then _claimFundsFromSyndicateForDistribution will not be called, even on BLS keys that are eligible for syndicate rewards. This leads to reduced rewards for user.

This is different from a second bug which discusses the possibility of using a stale acculmulatedETHPerLP.

Impact

Users will not receive rewards for claims of valid public keys if first passed key is not part of syndicate.

Recommended Mitigation Steps

Drop the i==0 requirement, which was intended to make sure the claim isn’t called multiple times. Use a hasClaimed boolean instead.

vince0656 (Stakehouse) confirmed


The original report as published on Code4rena, by Trust. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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 code uses the first key's syndicate membership as a gate for the entire claim, instead of checking each key or using a separate flag to prevent multiple claims.

Impact

Users will not receive rewards for claims of valid public keys if first passed key is not part of syndicate.

What the attacker needed

First BLS key not in syndicate; other keys are valid

The fix

The i==0 condition should be removed and a hasClaimed boolean used instead to prevent multiple claims.

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 lets users claim rewards for several keys at once. It only checks the first key to decide whether to fetch rewards from a shared pool. If that first key is no longer valid, the whole claim is skipped, so users miss out on rewards for their other valid keys.

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.

More by Trust

View all

77 more disclosed reports, best first.

More from LSD Network - Stakehouse contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.