Skip to content
Business logic Audit finding Intermediate

Incorrect parameters

The report identifies two parameter-passing mistakes in the Illuminate protocol: one function approves a non-existent token instead of the underlying token, and another passes a slippage ratio where a minimum amount is expected. These errors could cause insufficient approvals or unexpected slippage.

HonorLt Follow with IllIllI

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2022-10-illuminate-judging/issues/233

Found by

HonorLt, IllIllI

Summary

Some functions and integrations receive the wrong parameters.

Vulnerability Detail

Here, this does not work:

Solidity
      } else if (p == uint8(Principals.Notional)) {
            // Principal token must be approved for Notional's lend
            ILender(lender).approve(address(0), address(0), address(0), a);

because it basically translates to:

Solidity
  } else if (p == uint8(Principals.Notional)) {
   if (a != address(0)) {
        Safe.approve(IERC20(address(0)), a, type(uint256).max);
  }

It tries to approve a non-existing token. It should approve the underlying token and Notional's token contract.

Another issue is with Tempus here:

Solidity
        // Swap on the Tempus Router using the provided market and params
        ITempus(controller).depositAndFix(x, lent, true, r, d);

        // Calculate the amount of Tempus principal tokens received after the deposit
        uint256 received = IERC20(principal).balanceOf(address(this)) - start;

        // Verify that a minimum number of principal tokens were received
        if (received < r) {
            revert Exception(11, received, r, address(0), address(0));
        }

It passes r as a slippage parameter and later checks that received >= r. However, in Tempus this parameter is not exactly the minimum amount to receive, it is the ratio which is calculated as follows:

Solidity
  /// @param minTYSRate Minimum exchange rate of TYS (denominated in TPS) to receive in exchange for TPS
    function depositAndFix(
        ITempusAMM tempusAMM,
        uint256 tokenAmount,
        bool isBackingToken,
        uint256 minTYSRate,
        uint256 deadline
    ) external payable nonReentrant {
...
  uint256 minReturn = swapAmount.mulfV(minTYSRate, targetPool.backingTokenONE());

Impact

Inaccurate parameter values may lead to protocol misfunction down the road, e.g. insufficient approval or unpredicted slippage.

Code Snippet

https://github.com/sherlock-audit/2022-10-illuminate/blob/main/src/Marketplace.sol#L236-L239

https://github.com/sherlock-audit/2022-10-illuminate/blob/main/src/Lender.sol#L189-L199

Tool used

Manual Review

Recommendation

Review all the integrations and function invocations, and make sure the appropriate parameters are passed.

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

How it worked

Root cause

Likely, the developers misunderstood the expected parameters of external contracts and passed incorrect values, such as a zero address for a token or a ratio instead of a minimum amount.

Impact

Inaccurate parameter values may lead to protocol misfunction, such as insufficient approval or unpredicted slippage.

What the attacker needed

None

The fix

Review all integrations and function invocations to ensure the appropriate parameters are passed.

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.

This report is about a smart contract that calls other contracts with incorrect arguments. For example, it tries to approve a token that doesn't exist, and it uses a ratio where a minimum amount is needed. Such mistakes can make the contract behave unexpectedly, like allowing too much slippage or failing to approve the right token.

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 HonorLt

View all

13 more disclosed reports, best first.

More from Illuminate Round 2

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.