attackers will keep stealing the `rewards` from Convex SPELL
The ConvexSpell contract only refunds CVX rewards to the user when closing a position, leaving CRV and extra rewards in the contract. An attacker can later call a refund function to steal these leftover rewards.
But ConvexSpell.openPositionFarm() only refund CVX to the user.
So the rest rewards will stay in the SPELL intel if someone (could be an attacker) invokes _doRefund() within closePositionFarm() with the same address tokens
Impact
Convex SPELL steals the user rewards
the protocol will lose some fees
attackers will keep stealing the rewards from Convex SPELL
// 6. Take out existing collateral and burn
IBank.Position memory pos = bank.getCurrentPositionInfo();
if (pos.collateralSize > 0) {
(uint256 pid, ) = wConvexPools.decodeId(pos.collId);
if (param.farmingPoolId != pid)
revert Errors.INCORRECT_PID(param.farmingPoolId);
if (pos.collToken != address(wConvexPools))
revert Errors.INCORRECT_COLTOKEN(pos.collToken);
bank.takeCollateral(pos.collateralSize);
wConvexPools.burn(pos.collId, pos.collateralSize);
_doRefundRewards(CVX);
}
Tool used
Manual Review
Recommendation
you should Refund all Rewards (CRV + CVX + the extra rewards)
Discussion
Ch-301
Escalate for 10 USDC
Convex docs are confirming this point
Diff
Convex allows liquidity providers to earn trading fees and claim boosted CRV without locking CRV themselves. Liquidity providers can receive boosted CRV and liquidity mining rewards with minimal effort:
Earn claimable CRV with a high boost without locking any CRV
Earn CVX rewards
Zero deposit and withdraw fees
Zero fees on extra incentive tokens (SNX, etc)
Convex allows liquidity providers to earn trading fees and claim boosted CRV without locking CRV themselves. Liquidity providers can receive boosted CRV and liquidity mining rewards with minimal effort:
Earn claimable CRV with a high boost without locking any CRV
Earn CVX rewards
Zero deposit and withdraw fees
Zero fees on extra incentive tokens (SNX, etc)
Valid high
This issue is a valid high along with another duplicate #42
sherlock-admin
Escalation accepted
Valid high
This issue is a valid high along with another duplicate #42
This issue's escalations have been accepted!
Contestants' payouts and scores will be updated according to the changes made on this issue.
The original report as published on Sherlock, by Bauer. 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.
Generating the AI write-up for this report.
This usually takes about a minute. You can read the original meanwhile; this page updates itself.
Writing the technical write-up
Writing the version for beginners
Checking every passage against the original
How it worked
Root cause
Likely the ConvexSpell contract's closePositionFarm function only calls _doRefundRewards for CVX, omitting other reward tokens like CRV and extra incentives.
What the attacker needed
Attacker can call refund function; rewards left in contract
The fix
The contract should refund all reward tokens (CRV, CVX, and extra rewards) to the user when closing a position.
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.
Generating the AI write-up for this report.
This usually takes about a minute. You can read the original meanwhile; this page updates itself.
Writing the technical write-up
Writing the version for beginners
Checking every passage against the original
When you use a farming contract, it should return all your earned rewards when you close your position. Here, the contract only returned one type of reward (CVX) and kept the others (CRV and extra tokens) inside itself. Anyone could then call a function to take those leftover rewards, so users lose them.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.