Skip to content
Business logic Audit finding Intermediate

Alter velo receptions computation

The initializeReceiverWith function uses a flag that can be bypassed by passing address(0), allowing the deployer to re-initialize the contract and set arbitrary values for redeemableVELO and redeemableUSDC. This could let the deployer mint extra VELO and manipulate redemption calculations to receive more tokens than expected.

0x1f8b Follow

Originally disclosed on Code4rena

Submitted by 0x1f8b, also found by hansfriese

The deployer can modify the values to obtain different values than expected.

Proof of Concept

The flag used in initializeReceiverWith to prevent re-initialization is fantomSender == address(0), however the provided address for that value is not checked to be different from address(0), so it could be initialized multiple times to establish that value.

This could allow minting multiple Velos into Velo.mintToRedemptionReceiver and setting the wrong value in redeemableVELO and redeemableUSDC to affect the calculations of the previewRedeem method and later receive larger amounts of tokens in lzReceive than expected.

Affected source code:

Recommended Mitigation Steps

  • Ensure that the provided addresses are not address(0).

pooltypes (Velodrome) acknowledged

Alex the Entreprenerd (judge) commented:

The warden has shown how, through a combination of misconfiguration and admin privilege, more tokens than expected could be transfered.

In looking at Velo and Minter we can see that RedemtionReceiver has to be set by minter which at deployment time will be the deployer.

I don’t believe the exploit can be applied after a correct configuration as Minter is unable to set a new RedemptionReceiver meaning only the original deployer could pull of the exploit only until they set minter to Minter.sol.

Because of the external requirements, Medium Severity is appropriate; however, I believe the likelihood of this attack being pulled off is minimal.


The original report as published on Code4rena, by 0x1f8b. 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 initialization guard checks a state variable that can be set to address(0), allowing repeated initialization.

What the attacker needed

Deployer privilege; before minter is set to Minter.sol

The fix

Ensure that the provided addresses are not address(0).

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.

A smart contract has a setup function that should only run once. It checks a value to see if setup already happened, but that check can be tricked by passing a special empty address. The person who deployed the contract could run setup again and change important numbers, potentially getting more tokens than they 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 0x1f8b

View all

21 more disclosed reports, best first.

More from Velodrome 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.