Skip to content
Business logic Audit finding Intermediate

CvxCrvRewardsLocker implements a swap without a slippage check that can result in a loss of funds through MEV

The CvxCrvRewardsLocker contract performs a token swap through the CRV cvxCRV pool without any slippage protection, because the minimum output value is set to zero. An attacker could front-run or sandwich the swap to extract value, causing a loss of funds for the contract.

Ruhum Follow

Originally disclosed on Code4rena

Submitted by Ruhum

The CvxCrvRewardsLocker contract swaps tokens through the CRV cvxCRV pool. But, it doesn’t use any slippage checks. The swap is at risk of being frontrun / sandwiched which will result in a loss of funds.

Since MEV is very prominent I think the chance of that happening is pretty high.

Proof of Concept

Here’s the swap: CvxCrvRewardsLocker.sol#L247-L252.

Recommended Mitigation Steps

Use a proper value for minOut instead of 0.

chase-manning (Backd) confirmed

gzeon (judge) decreased severity to Medium and commented:

According to C4 Judging criteria:

Unless there is something uniquely novel created by combining vectors, most submissions regarding vulnerabilities that are inherent to a particular system or the Ethereum network as a whole should be considered QA. Examples of such vulnerabilities include front running, sandwich attacks, and MEV.

However since there is a configurable minOut that is deliberately set to 0, this seems to be a valid issue. I am judging this as Medium Risk.


The original report as published on Code4rena, by Ruhum. 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 swap call passes a minimum output of zero instead of a real slippage limit, so the trade accepts any price.

Impact

The swap could be front-run or sandwiched, resulting in a loss of funds; the judge rated it Medium because the minimum output is configurable but deliberately set to zero.

What the attacker needed

Contract performs a token swap; attacker can front-run or sandwich

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 a program trades one token for another, it can state the least it is willing to receive. Here that minimum was left at zero, so anyone watching the trade can step in front of it, shift the price, and take the difference. The program still completes the trade but gets less value than it should.

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 Ruhum

View all

55 more disclosed reports, best first.

More from Backd Tokenomics 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.