Skip to content
Business logic Audit finding Intermediate

Users Will Lose Rewards If The Shelter Mechanism Is Enacted Before A Recent Checkpoint

When the shelter mechanism drains funds to a separate contract, users' deposited balances remain recorded in the staking wrapper, but their rewards are only updated on deposit or withdrawal. An attacker (or the shelter action itself) could cause users to permanently lose accrued rewards that are not checkpointed before the drain.

leastwood Follow

Originally disclosed on Code4rena

Submitted by leastwood

The shelter mechanism aims to protect the protocol’s users by draining funds into a separate contract in the event of an emergency. However, while users are able to reclaim their funds through the Shelter.sol contract, they will still have a deposited balance from the perspective of ConvexStakingWrapper.sol.

Because users will only receive their rewards upon depositing/withdrawing their funds due to how the checkpointing mechanism works, it is likely that by draining funds to the Shelter.sol contract, users will lose out on any rewards they had accrued up and until that point. These rewards are unrecoverable and can potentially be locked within the contract if the reward token is unique and only belongs to the sheltered _pid.

Proof of Concept

ConvexStakingWrapper.sol

Recommended Mitigation Steps

Consider allowing users to call a public facing _checkpoint function once their funds have been drained to the Shelter.sol contract. This should ensure they receive their fair share of rewards. Careful consideration needs to be made when designing this mechanism, as by giving users full control of the _checkpoint function may allow them to continue receiving rewards after they have withdrawn their LP tokens.

leekt (Concur) confirmed

Alex the Entreprenerd (judge) commented:

The warden has shown how using the Shelter can cause depositors to lose yield they had accrued.

Specifically the loss of yield will be for the time of new rewards accrued since the last _checkpoint.

Moving to a global index (to compare user accrual against global rewards), or modifying the shelter to account for yield could be a potential way to mitigate.

The sponsor confirmed and I believe medium severity to be appropriate because this is a Owner Privilege + Yield Loss finding.


The original report as published on Code4rena, by leastwood. 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

Likely the reward checkpointing only occurs on deposit/withdraw, so draining funds via the shelter bypasses the checkpoint and leaves accrued rewards unaccounted for.

Impact

Users could permanently lose accrued rewards that are unrecoverable and may be locked in the contract if the reward token is unique to the sheltered pool.

What the attacker needed

Shelter mechanism is enacted; user has accrued unclaimed rewards

The fix

The report recommends allowing users to call a public checkpoint function after funds are drained, while carefully designing it to prevent continued rewards after withdrawal; the judge also suggested using a global index or modifying the shelter to account for yield.

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.

This is a smart contract staking system. Users earn rewards over time, but the contract only updates their reward balance when they deposit or withdraw. If an emergency 'shelter' moves all funds out without updating rewards first, users lose the rewards they earned but never claimed.

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 leastwood

View all

70 more disclosed reports, best first.

More from Concur Finance 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.