Not minting iPTs for lenders in several lend functions
Several lend functions in the Lender contract transfer the lender's funds to external principal token protocols but never mint the corresponding Illuminate principal tokens back to the lender. A lender using these functions would lose their funds without receiving the iPTs they expected.
Submitted by Metatron, also found by 0x52, auditor0517, cccz, datapunk, hansfriese, hyh, kenzo, kirk-baird, shenwilly, unforgiven, and WatchPug
Impact
Using any of the lend function mentioned, will result in loss of funds to the lender - as the funds are transferred from them but no iPTs are sent back to them!
Basically making lending via these external PTs unusable.
Proof of Concept
There is no minting of iPTs to the lender (or at all) in the 2 lend functions below:
https://github.com/code-423n4/2022-06-illuminate/blob/912be2a90ded4a557f121fe565d12ec48d0c4684/lender/Lender.sol#L247-L305
Corresponding to lending of (respectively): swivel element
Furthermore, in: https://github.com/code-423n4/2022-06-illuminate/blob/912be2a90ded4a557f121fe565d12ec48d0c4684/lender/Lender.sol#L227-L234 Comment says “Purchase illuminate PTs directly to msg.sender”, but this is not happening. sending yield PTs at best.
Recommended Mitigation Steps
Mint the appropriate amount of iPTs to the lender - like in the rest of the lend functions.
sourabhmarathe (Illuminate) confirmed
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 lend functions for the swivel and element protocols (and one branch of another) omit the minting call that the other lend functions perform, so no iPTs are issued to the lender.
Impact
A lender using these lend functions loses the transferred funds because no iPTs are returned, making lending through these external PTs unusable.
What the attacker needed
Lender uses an affected lend function
The fix
The lend functions should mint the appropriate amount of iPTs to the lender, as the other lend functions do.
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 principal token (PT) is a token representing a deposit that will be repaid later. Here, when someone lends through certain functions, their money is moved out but the matching token that proves they are owed money is never created for them, so they lose the funds.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.