Skip to content
Business logic Audit finding Intermediate

Users can prevent protocol from rebalancing for his gain and cause loss of funds for protocol and its users

mrMorningstar Follow with 0xGondar, bumbleb33 and 2 others

Originally disclosed on Code4rena

Submitted by mrMorningstar, also found by 0xGondar, bumbleb33, bumbleb33, and Evo

https://github.com/code-423n4/2024-12-lambowin/blame/874fafc7b27042c59bdd765073f5e412a3b79192/src/rebalance/LamboRebalanceOnUniwap.sol#L62

The protocol have a vETH token that aims to be pegged to the ETH so the ration of vETH -> ETH = 1:1. When depeg happens the protocol can mitigate that via rebalance function in LamboRebalanceOnUniwap that looks like this:

function rebalance(uint256 directionMask, uint256 amountIn, uint256 amountOut) external nonReentrant {
    uint256 balanceBefore = IERC20(weth).balanceOf(address(this));
    bytes memory data = abi.encode(directionMask, amountIn, amountOut);
    IMorpho(morphoVault).flashLoan(weth, amountIn, data);
    uint256 balanceAfter = IERC20(weth).balanceOf(address(this));
    uint256 profit = balanceAfter - balanceBefore;
    require(profit > 0, "No profit made");
}

This function is designed to rebalance ratio by taking a flashloan from MorphoVault, which will be used on UniswapV3 to make a swap, while at the same time make sure there is a profit for the caller which later can be transferred via the extractProfit function in the same contract.

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

What is known

A medium-severity business logic bug in Lambo.win. Code4rena made it public on 3 February 2025. Found in the 2024-12-lambowin audit contest (finding M-08), also found by 4 other wardens.

About Business logic

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

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 mrMorningstar

View all

6 more disclosed reports, best first.

More from Lambo.win

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.