Skip to content
Business logic Audit finding Advanced

Agents can evade the full extent of a slash

The slashTimestamp function returns a timestamp that can be manipulated by an agent to reduce or evade slashing penalties. An attacker can frontrun a reduction in their operator shares with a borrow, causing the slashable collateral to be calculated as zero.

Uddercover Follow

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-07-cap-judging/issues/316

Found by

Uddercover

Summary

The Cap Delegation.sol::slashTimestamp function returns a timestamp for historically determination of an agent's slashable stake, but this returned timestamp can make it possible for an operator to evade the full extent of a slash.

The slashTimestamp is chosen as either the agent's last borrow timestamp or the last delegation epoch start timestamp, whichever is later. But this then creates only a small window for the agent to be slashable. An agent's slashable collateral can fall in the same block as when they borrow, for example if their operator shares is reduced in the symbiotic delegator and they frontrun the reduction transaction with a borrow. Since the slashTimestamp will always be the last borrow time or later, the agent's slashable stake would always return less than it should be. The readme states that the cap delegation epoch duration will always be shorter than the symbiotic vault epoch duration, so even if the agent can have a greater penalty by the symbiotic vault standards, they will be able to get off with less.

Root Cause

Cap protocol's slashTimestamp() function returns a timestamp that allows an agent to avoid the full penalty of a slash

Internal Pre-conditions

NIL

External Pre-conditions

The agent's slashable collateral falls in the same block as they borrow from cap

Attack Path

  1. Agent borrows amount from Lender.sol
  2. Agent frontruns symbiotic OPERATOR_NETWORK_SHARES_SET_ROLE holder transaction to reduce agent vault shares to 0, with a borrow in the same block
  3. Any subsequent attempts to slash the agent becomes impossible as slashTimestamp always returns slashable collateral as 0

For example, take a symbiotic vault epoch duration of 60 seconds, a current block.timestamp of 0 and a cap epoch duration of 10 seconds.

  • At block.timestamp = 0 seconds: Agent borrows from cap vaults
  • At block.timestamp = 30 seconds: Agent frontruns shares reduction transaction with minimum amount borrow.
  • At block.timestamp = 31 seconds: cap epoch = 3, slash timestamp = 30 i.e the last borrow timestamp, and agent slashable stake = 0
  • At block.timestamp = 50 seconds: cap epoch = 5 and `slash timestamp = (5 - 1) * 10 = 40
  • Agent's slashable stake and coverage at 40 = 0,
  • Agent evades slashing even as the symbiotic epoch still considers that agent as slashable

Impact

Agents are not fully penalized, even potentially evading penalty completely

PoC

Add the following test function to Lender.borrow.t.sol:

Solidity
function testAgentEvadeSlash() public {
        //agent borrows
        vm.startPrank(user_agent);
        assertEq(usdc.balanceOf(user_agent), 0);
        lender.borrow(address(usdc), 500e6, user_agent);
        assertGt(usdc.balanceOf(user_agent), 0);
        vm.stopPrank();

        //some time later, agent front runs share update with another borrow
        vm.warp(block.timestamp + 5 days);
        vm.startPrank(user_agent);
        lender.borrow(address(usdc), type(uint256).max, user_agent);
        vm.stopPrank();

        vm.startPrank(env.symbiotic.users.vault_admin);
        _symbioticVaultDelegateToAgent(symbioticWethVault, env.symbiotic.networkAdapter, user_agent, 0);
        vm.stopPrank();

        vm.warp(block.timestamp + 1);

        uint256 slashableCollateral = delegation.slashableCollateral(user_agent);
        uint256 coverage = delegation.coverage(user_agent);
        assertEq(slashableCollateral, 0);
        assertEq(coverage, 0);

        (,,,,, uint256 health) = lender.agent(user_agent);
        assertEq(health, 0);
    }

Mitigation

No response

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

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 slashTimestamp is set to the later of the last borrow time or the last epoch start, which allows an agent to reset the slashable window by borrowing just before a stake reduction.

Impact

Agents may not be fully penalized and could potentially evade the penalty completely.

What the attacker needed

Agent has borrowed from Cap; Agent can frontrun a share reduction transaction

How it was found

  1. Agent borrows an amount from Lender.sol
  2. Agent frontruns a transaction that reduces their operator shares to zero, with a borrow in the same block
  3. Subsequent slashing attempts return zero slashable collateral because slashTimestamp is set to the last borrow time

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.

In a lending system, if a borrower misbehaves, the system can take some of their collateral as a penalty (a slash). This report shows that the timing of when the penalty is calculated can be gamed: by borrowing just before someone reduces their stake, the borrower makes the system think they have nothing to take, so they escape the penalty.

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 Uddercover

View all

1 more disclosed report, best first.

More from Cap

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.