Skip to content
Business logic Audit finding Intermediate

Vault.claimRewards can break if Convex changes the operator

The Vault.claimRewards function assumes CVX tokens are always minted when claiming CRV rewards, but if Convex changes its operator, no CVX is minted and the claim reverts, blocking users from receiving their CRV and extra rewards.

minhtrng Follow

Originally disclosed on Code4rena

Submitted by minhtrng

Vault.claimRewards assumes that CVX will always get minted to the Vault (if there is a CRV reward). If CVX does not get minted, the claim will fail, preventing payout of CRV and extra rewards. Looking at the Convex code there can be the case where the operator has changed, causing no mint to happen.

Proof of Concept

The function Vault.claimRewards calculates the CVX reward that is expected, which is then meant to be transferred to AMPHClaimer and the minter:

...
 _totalCvxReward += _calculateCVXReward(_crvReward);
...
// Claim AMPH tokens depending on how much CRV and CVX was claimed
_amphClaimer.claimAmph(this.id(), _totalCvxReward, _totalCrvReward, _msgSender());
...
if (_totalCvxReward > 0) CVX.transfer(_msgSender(), _totalCvxReward);

The Cvx contract which performs the mint contains the following logic:

function mint(address _to, uint256 _amount) external {
    if(msg.sender != operator){
        //dont error just return. if a shutdown happens, rewards on old system
        //can still be claimed, just wont mint cvx
        return;
    }

The operator is the Booster contract which is called by BaseRewardPool which again is called by Vault.claimRewards. As can be seen in the snippet, the Convex protocol enables a shutdown case that wont break the BaseRewardPool, however the Vault implementation has not taken that case into consideration.

Severity deemed to be medium, due to high impact but special requirement.

Recommended Mitigation Steps

Check the CVX balance of the vault before and after the claim to assert that the correct CVX amount has been minted.

0xShaito (Amphora) confirmed and commented:

Impact: Users wouldn’t be able to claim rewards anymore and accumulated rewards are lost. No user deposits at risk!


The original report as published on Code4rena, by minhtrng. 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 Vault contract does not check whether CVX was actually minted before trying to transfer it, so a change in Convex's operator causes the transfer to fail.

Impact

Users could be unable to claim rewards, and accumulated rewards may be lost, though user deposits are not at risk.

What the attacker needed

Convex changes its operator

The fix

The Vault should check its CVX balance before and after the claim to ensure the correct amount was minted.

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.

When you claim rewards, the code expects a certain token (CVX) to be created automatically. If the system that creates it changes its rules, that token is not created, and the whole claim fails, so you get nothing. This means your earned rewards can get stuck.

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 minhtrng

View all

11 more disclosed reports, best first.

More from Amphora Protocol

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.