Able to mint any amount of PT
The lend functions in the Illuminate protocol did not validate the addresses of external contracts (Yieldspace pool, Sense AMM, APWine pool) passed as arguments. A malicious user could supply a contract they control that returns an arbitrary value for the amount of principal tokens (PT) gained, causing the protocol to mint more PT than deserved.
Submitted by dipp, also found by 0x1f8b, bardamu, Chom, datapunk, Alex the Entreprenerd, GimelSec, hyh, jah, kenzo, kirk-baird, Kumpa, ladboy233, Metatron, oyc109, shenwilly, simon135, unforgiven, and zer0dot_
Impact
Some of the lend functions do not validate addresses sent as input which could lead to a malicous user being able to mint more PT tokens than they should.
Functions affect:
Proof of Concept
In the Illuminate and Yield lend function:
- Let the Yieldspace pool
ybe a malicious contract that implements theIYieldinterface. - The
baseandmaturityfunctions forymay return any value so the conditions on lines 208 and 210 are easily passed. - The caller of
lendsends any amountafor the desired underlyingu. - If principal token
pcorresponds to the Yield principal, then theyieldfunction is called which has a return value controlled by the malicious contracty. - The
mintfunction is then called for the principal token with an underlyinguand a maturitymwhich will then mint thereturnedamount of principal tokens to the malicious user.
In the Sense lend function:
- Let the amm
xinput variable be a malicous contract that implements theISenseinterface. - The malicious user sends any amount of underlying to
Lender.sol. - Since the amm isn’t validated, the
swapUnderlyingForPTsfunction can return any amount forreturnedthat is used to mint the Illuminate tokens. - The malicious user gains a disproportionate amount of PT.
In the APWine lend function:
- Let the APWine
poolinput variable be a malicous contract that implements theIAPWineRouterinterface. - The malicious user sends any amount of underlying to
Lender.sol. - The
swapExactAmountInfunction of the maliciouspoolcontract returns any amount forreturned. - The
mintfunction is called for the PT with underlyinguand maturitymwith the attacker controlledreturnedamount.
Recommmended Mitigation Steps
Consider validating the input addresses of y, x and pool through a whitelisting procedure if possible or validating that the returned amounts correspond with the amount of PT gained from the protocols by checking the balance before and after the PTs are gained and checking the difference is equal to returned.
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 lack of validation (e.g., whitelisting) on the external contract addresses passed to the lend functions, allowing an attacker to supply a malicious contract that returns an arbitrary value used for minting.
Impact
A malicious user could mint more PT tokens than they should, potentially gaining a disproportionate amount of PT.
What the attacker needed
Attacker can deploy a malicious contract; attacker can call the lend function
The fix
The protocol should validate the input addresses (y, x, pool) through a whitelisting procedure or verify that the returned amounts match the actual PT gained by checking balances before and after.
How it was found
- Deploy a malicious contract implementing the IYield interface.
- Call the Illuminate and Yield lend function with this malicious contract as the Yieldspace pool.
- The malicious contract's base and maturity functions return values that pass the checks.
- Send any amount of underlying tokens to the lend function.
- The malicious contract's yield function returns an arbitrary amount.
- The protocol mints that arbitrary amount of principal tokens to the attacker.
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.
The protocol lets users lend tokens through other services. It trusted whatever address the user gave for that service. An attacker could give their own fake service that lies about how many tokens it returned, so the protocol gave the attacker extra tokens.
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.