Restaker rewards on zero coverage agent will be stolen by subsequent restaker interest realization
When an agent's coverage is zero, the Delegation contract returns early and leaves restaker interest it has already received stuck in its balance. A later restaker interest realisation sweeps that stuck amount to a different subnetwork, so those restakers receive more rewards than they are owed.
Uddercover Follow with attacker_code, montecristo and 1 other
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2025-07-cap-judging/issues/467
Found by
Uddercover, attacker_code, montecristo, silver_eth
Summary
Lender contract will transfer realized restaker interest to Delegation contract. Delegation contract is supposed to transfer the received amount to network middleware and delegate rewards distribution.
However, in an edge case where agent's coverage is 0, Delegation contract skips such flow. Thus, received amount will be stuck in Delegation contract until the next restaker interest realization.
In this case, subsequent restaker interest realization will sweep stuck amount and target restakers receive more rewards than deserved.
Root Cause
Root cause lies in the fact that Delegation contract skips network reward distribution if agent's current coverage is 0:
File: cap-contracts/contracts/delegation/Delegation.sol
55: function distributeRewards(address _agent, address _asset) external {
56: DelegationStorage storage $ = getDelegationStorage();
57: uint256 _amount = IERC20(_asset).balanceOf(address(this));
58:
59: uint256 totalCoverage = coverage(_agent);
60:@> if (totalCoverage == 0) return;
61:
62: address network = $.agentData[_agent].network;
63: IERC20(_asset).safeTransfer(network, _amount);
64: ISymbioticNetworkMiddleware(network).distributeRewards(_agent, _asset);
However, Delegation contract already has received restaker interest from Lender contract:
File: cap-contracts/contracts/lendingPool/libraries/BorrowLogic.sol
217:@> IVault(reserve.vault).borrow(_asset, realizedInterest, $.delegation);
218:@> IDelegation($.delegation).distributeRewards(_agent, _asset);
Thus, restaker interest will be stuck at Delegation contract.
Due to L57, next restaker interest realization will sweep this amount to another subnetwork.
Internal Pre-conditions
- Debt repay or liquidation happens on zero-coverage agent's position.
Zero coverage can happen in one of the following scenarios:
- All restaked amount are scheduled to be withdrawn
- Agent's network limit is set to 0
- Protocol team repays on bad debt position. More specifically, previous liquidation already set agent's delegation to zero.
External Pre-conditions
n/a
Attack Path
n/a
Impact
Since realizeRestakerInterest is public, restaker rewards can be stolen by any interested party (e.g. agent or restaker)
PoC
No response
Mitigation
Don't send restaker interest to Delegation contract if coverage is 0.
Instead, send it to FeeAuction contract so that the interest is distributed among scUSD holders.
Alternatively, one can fix maxRestakerRealization so that realized interest amount is 0 when agent's coverage is 0.
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 reward distribution function returns early when coverage is zero without forwarding or refunding the interest already transferred to it, so the balance carries over to the next call.
Impact
Restaker rewards could be stolen by any interested party, since realiseRestakerInterest is public and the stuck amount is paid to the wrong restakers on the next realisation.
What the attacker needed
Agent coverage is zero; a debt repay or liquidation occurs; a later realisation is triggered
The fix
The interest should not be sent to the Delegation contract when coverage is zero; it should go to the FeeAuction contract for scUSD holders, or the realisation amount should be zero in that case.
How it was found
- A debt repayment or liquidation occurs on a position whose agent has zero coverage.
- The lending logic transfers the realised restaker interest to the Delegation contract and calls distributeRewards.
- distributeRewards sees zero total coverage and returns without sending the funds onward.
- The interest stays in the Delegation contract balance.
- A later restaker interest realisation picks up the whole balance and forwards it to another subnetwork.
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 contract that hands out rewards checks whether an agent still has any coverage (money backing it). If coverage is zero it stops early, but the reward money has already been sent to it, so the money just sits there. The next time rewards are paid out, that leftover money is included and goes to whoever is being paid then, which is not who earned it.
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.