Skip to content
Business logic Audit finding Intermediate

Lender.mint() May Take The Illuminate PT As Input Which Will Transfer And Mint More Illuminate PT Cause an Infinite Supply

The Lender.mint() function allows the principal token to be the same as the Illuminate PT, so a user can transfer Illuminate PT to the contract and receive an equal amount of newly minted Illuminate PT. This can be repeated indefinitely, inflating the supply and leaving extra tokens in the Lender contract.

kirk-baird Follow

Originally disclosed on Code4rena

Submitted by kirk-baird, also found by cccz, kenzo, and unforgiven

Lender.mint() may use p = 0 which will mean principal is the same as principalToken(u, m) i.e. the Illuminate PT. The impact is we will transfer some principal to the Lender contract and it will mint us an equivalent amount of principal tokens.

This can be repeated indefinitely thereby minting infinite tokens. The extra balance will be store in Lender.

This is rated high as although the attacker does not receive the extra tokens stored within the Lender they may be consumed via any contract which has been approved via the approve() functions (e.g. Redeemer).

Proof of Concept

Lender.mint()

    function mint(
        uint8 p,
        address u,
        uint256 m,
        uint256 a
    ) public returns (bool) {
        //use market interface to fetch the market for the given market pair
        address principal = IMarketPlace(marketPlace).markets(u, m, p);
        //use safe transfer lib and ERC interface...
        Safe.transferFrom(IERC20(principal), msg.sender, address(this), a);
        //use ERC5095 interface...
        IERC5095(principalToken(u, m)).mint(msg.sender, a);

        emit Mint(p, u, m, a);

        return true;
    }

Steps:

  • Lender.lend() with p = 0 to get some Illuminate principal tokens

  • token.approve() gives Lender allowance to spend these tokens

  • loop:

    • Lender.mint() with p = 0 minting more principal tokens

Recommended Mitigation Steps

In Lender.mint() ensure p != uint8(MarketPlace.Principals.Illuminate)) .

gzeoneth (judge) decreased severity to Medium and commented:

The 1:1 circular minting will cause a few issues as highlighted in the duplicate that impact the functionality of the protocol, but no direct fund loss.

sourabhmarathe (Illuminate) disagreed with severity and commented:

As noted above, this will not cause major loss of funds. As a result, this should be considered a lower level issue. However, given that it could lead to problems down the line, we should address this issue.


The original report as published on Code4rena, by kirk-baird. 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 mint function does not prevent the principal token from being the same as the Illuminate principal token, allowing a circular mint.

Impact

The attacker does not directly receive the extra tokens stored in the Lender, but those tokens could be consumed by any contract approved to spend them, such as the Redeemer; the judge noted no direct fund loss.

What the attacker needed

Ability to call Lender.lend() and Lender.mint(); approval to spend Illuminate PT

The fix

The mint function should be changed to reject the case where the principal is the Illuminate principal token.

How it was found

  1. Call Lender.lend() with p = 0 to obtain Illuminate principal tokens.
  2. Approve the Lender contract to spend those tokens.
  3. Repeatedly call Lender.mint() with p = 0 to mint more principal tokens.

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 lets you deposit a token and get the same token back as a new mint. Because the contract does not check that the token you deposit is different from the token it creates, you can keep doing this to create more and more tokens. The extra tokens pile up in the contract, and other contracts that trust it might later use them.

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 kirk-baird

View all

32 more disclosed reports, best first.

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